Getting Bacula running on my MacBook
April 2nd, 2011I 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:
sudo port install bacula +client_only
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...
