Getting Bacula running on my MacBook / OSX

I recently acquired a MacBook Pro. Things are going well. I’m using Time Capsule, but I also want to use Bacula. I went with MacPorts: This article will show how I got Bacula running on OSX.

sudo port install bacula +client_only

NOTE: for more recent version of MacPorts, this command worked: sudo port install bacula +client_only-console_bat

The install looked something like this:

[dan@dent:~] $ sudo port uninstall bacula
--->  Deactivating bacula @5.0.3_2+client_only
--->  Cleaning bacula
--->  Uninstalling bacula @5.0.3_2+client_only
--->  Cleaning bacula
[dan@dent:~] $ sudo port install bacula +client_only
--->  Computing dependencies for bacula
--->  Fetching bacula
--->  Verifying checksum(s) for bacula
--->  Extracting bacula
--->  Applying patches to bacula
--->  Configuring bacula
--->  Building bacula
--->  Staging bacula into destroot
--->  Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting bacula with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo port load bacula
###########################################################
--->  Installing bacula @5.0.3_2+client_only
--->  Activating bacula @5.0.3_2+client_only
--->  Cleaning bacula
[dan@dent:~] $

So… I ran the command mentioned above:

sudo port load bacula

And I could see something running:

[dan@dent:~] $ ps auwx | grep bacula
dan      70072   0.0  0.0  2435120    508 s003  R+    8:06PM   0:00.00 grep bacula
root     70067   0.0  0.0  2454604   1076   ??  Ss    8:05PM   0:00.00 /opt/local/bin/daemondo 
--label=bacula --start-cmd /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper start ; 
--stop-cmd /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper stop ; --restart-cmd 
/opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper restart ; --pid=none
[dan@dent:~] $

But this didn’t make sense… I could not connect via status client. After several attempts via:

sudo launchctl stop org.macports.bacula

I decided to unload things and try running the startup command manually:

sudo launchctl unload /Library/LaunchDaemons/org.macports.bacula.plist

And running the manual startup:

[dan@dent:~] $ sudo /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper start
02-Apr 20:40 dent-fd: ERROR TERMINATION at util.c:867
Working Directory: "/var/db/bacula" not found. Cannot continue.

Ahh, easily fixed:

[dan@dent:~] $ sudo mkdir /var/db/bacula

And starting it again:

[dan@dent:~] $ sudo /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper start
[dan@dent:~] $ ps auwx | grep bacula
dan      70364   0.0  0.0  2435120    556 s003  R+    8:40PM   0:00.00 grep bacula
root     70362   0.0  0.0  2444520    456   ??  Ss    8:40PM   0:00.00 /opt/local/sbin/bacula-fd -c /opt/local/etc/bacula/bacula-fd.conf

Ahh, good, it is running. And, I can connect:

*status client=dent-fd
Connecting to Client dent-fd at dent.example.org:9102

dent-fd Version: 5.0.3 (04 August 2010)  i386-apple-darwin10.7.3 osx 10.7.3
Daemon started 02-Apr-11 20:40. Jobs: run=0 running=0.
 Heap: heap=0 smbytes=12,747 max_bytes=12,894 bufs=45 max_bufs=46
 Sizeof: boffset_t=8 size_t=8 debug=0 trace=0

Running Jobs:
Director connected at: 02-Apr-11 20:40
No Jobs running.
====

Terminated Jobs:
====
*

I found I could not stop bacula:

sudo /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper stop

So I started looking at /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper and found a problem with this line:

PID=/opt/local/var/run/bacula-fd.*.pid

Which I changed to this:

PID=/var/run/bacula-fd.9102.pid

Then I could start and stop bacula-fd at will using /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper

Next, let’s load that up into launchctl:

sudo launchctl load /Library/LaunchDaemons/org.macports.bacula.plist

And verify that bacula-fd is running:

[dan@dent:~] $ ps auwx | grep bacula
root     70443   0.0  0.0  2445888   1056   ??  Ss    9:01PM   0:00.00 /opt/local/bin/daemondo 
--label=bacula --start-cmd /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper start ; 
--stop-cmd /opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper stop ; --restart-cmd 
/opt/local/etc/LaunchDaemons/org.macports.bacula/bacula.wrapper restart ; --pid=none
dan      70452   0.0  0.0  2435120    560 s003  R+    9:01PM   0:00.00 grep bacula
root     70447   0.0  0.0  2467268    632   ??  Ss    9:01PM   0:00.00 /opt/local/sbin/bacula-fd -c /opt/local/etc/bacula/bacula-fd.conf
[dan@dent:~] $ 

Now it's running... We'll see if it's running after I reboot the laptop...
Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

7 thoughts on “Getting Bacula running on my MacBook / OSX”

  1. Good work friend !

    I have some questions.. The daemon file is running with the name bacula-fd, for example if I have two or more Mac running bacula backup,how can I do to change the file daemon names and what do I have to modify? I’m running a Bacula Server in Ubuntu 14.04 with Webmin.

    Thanks a lot..

    Sorry for my bad english

  2. Followed this, director can see the client OK I think but the client on the macbook is not doing the backup when I kick off a full job. logs anywhere? bacula-fd is sleeping or so top says. Does the fd only talk to the sd or the sd talk to the fd? The former happens but a fwall stops the opposite.

  3. Hello Dan,

    you seem to have one of the most elaborate bacula mac installation guides as far is i can tell. Im currently trying to follow your Guide but sadly ive run into problems on the very first command… The Commandline looks like this

    sudo port install bacula +client_only
    password:
    —> Computing dependencies for bacula
    —> Configuring bacula
    Error: Failed to configure bacula

    It then directs me to two log files which dont really give me insight to the problem at hand.
    Now i understand that your post is pretty outdated but browsing through your site i can see you still use bacula. Do you have any ideas or pointers that could help me?
    Thanks alot

    1. I suspect the problem you encountered was this one:

      :info:configure configure: error: Unable to find Qt4 installation needed by bat
      

      Using the amended instruction allowed me to avoid the installation of bat.

Leave a Comment