Bacula-client service fails to start on boot

  • I find that the bacula client fails to restart after a reboot on 2.1 because it can't find the /var/db/bacula directory.

    The fix was to modify /usr/local/etc/rc.d/ to create this directory.

    # $FreeBSD: ports/sysutils/bacula-server/files/,v 1.9 2012/12/16 16:36:39 svnexp Exp $
    # PROVIDE: bacula_fd
    # KEYWORD: shutdown
    # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
    # to enable this service:
    # bacula_fd_enable  (bool):  Set to YES by default.
    #               Set it to YES to enable bacula_fd.
    # bacula_fd_flags (params):  Set params used to start bacula_fd.
    . /etc/rc.subr
    load_rc_config $name
    : ${bacula_fd_enable="YES"}
    : ${bacula_fd_flags=" -u root -g wheel -v -c /usr/pbi/bacula-i386/etc/bacula-fd.conf"}
    : ${bacula_fd_pidfile="/var/run/"}
    # This directory is missing on boot
    mkdir /var/db/bacula
    run_rc_command "$1"

    Seems odd that this hasn't been reported elsewhere. Could there be something awry with my config?


  • It is a bug on nanoBSD. I installed it on a 2.1-RC2 test system and somewhere in the unpacking of the PBI and the install it happily created /var/db/bacula
    But /var is a memory file system on nanoBSD. After a reboot, /var/db/bacula is gone and there is no code anywhere to create it.
    It should work OK on full installs, where /var persists across boot.

  • This problem remains on 2.1.5-RELEASE

    I just countered it:

    [2.1.5-RELEASE][]/etc(14): /usr/pbi/bacula-amd64/sbin/bacula-fd -d 10 -f -c /usr/pbi/bacula-amd64/etc/bacula-fd.conf
    18-Oct 12:02 -fd: ERROR TERMINATION at util.c:871
    Working Directory: "/var/db/bacula" not found. Cannot continue.

  • My fix:

    mkdir /usr/local/bacula/
    chown bacula:bacula /usr/local/bacula

    Run vipw from the command line and adjust the home directory for bacula to be the above mentioned directory.

    That is insufficient to get the correct WorkingDirectory value in bacula-fd.conf file.

    The path, /var/db/bacula is hardcoded at

    Is that the problem?  I believe so.  If I edit /usr/local/pkg/ and put the new path in there, the correct configuration is saved.

    In addition, all instances of BACULA_LOCALBASE . /etc/bacula-fd.conf in /usr/local/pkg/ needs to be BACULA_LOCALBASE . /etc/bacula/bacula-fd.conf

    NOW it runs:

    [2.1.5-RELEASE][]/cf(110): ps auwx | grep bacula
    root    6659  0.0  0.3 28864  5756  ??  Is  12:56PM  0:00.00 /usr/pbi/bacula-amd64/sbin/bacula-fd -u root -g wheel -v -c /usr/pbi/bacula-amd64/etc/bacula/bacula-fd.conf
    root    9672  0.0  0.1  6088  1400  1  R+  12:56PM  0:00.00 grep bacula

    In addition, the code seems to append -dir to the Director Name via pkg_edit.php?xml=bacula-client.xml&act=edit&id=0

    Hope this helps to fix this bug.

Log in to reply