Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Bacula-client service fails to start on boot

    Scheduled Pinned Locked Moved pfSense Packages
    4 Posts 3 Posters 3.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Steve Evans
      last edited by

      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/bacula-fd.sh to create this directory.

      #!/bin/sh
      #
      # $FreeBSD: ports/sysutils/bacula-server/files/bacula-fd.in,v 1.9 2012/12/16 16:36:39 svnexp Exp $
      #
      # PROVIDE: bacula_fd
      # REQUIRE: DAEMON
      # 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
      
      name="bacula_fd"
      rcvar=${name}_enable
      command=/usr/pbi/bacula-i386/sbin/bacula-fd
      
      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/bacula-fd.9102.pid"}
      
      pidfile="${bacula_fd_pidfile}"
      
      # 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?

      Steve

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        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.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • D
          dvl
          last edited by

          This problem remains on 2.1.5-RELEASE

          I just countered it:

          [2.1.5-RELEASE][admin@pfsense.unixathome.org]/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.

          1 Reply Last reply Reply Quote 0
          • D
            dvl
            last edited by

            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 https://packages.pfsense.org/packages/config/bacula-client/bacula-client.inc

            Is that the problem?  I believe so.  If I edit /usr/local/pkg/bacula-client.inc 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/bacula-client.inc needs to be BACULA_LOCALBASE . /etc/bacula/bacula-fd.conf

            NOW it runs:

            [2.1.5-RELEASE][admin@pfsense.unixathome.org]/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.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.