Mar 232010
 

While creating the FreeBSD package for 5.0.0, I noticed a few new things to be aware of.

With 5.0.0 comes a new backup catalog script. It parses the bacula-dir.conf file and extracts what it needs from that. This means you only need to specify the database connection information in one place and it is not passed to a script via the command line.

If you see this error while running that script:

25-Jan 16:37 ducky.unixathome.org-dir JobId 32500: shell command: run BeforeJob “/usr/local/share/bacula/make_catalog_backup.pl MyCatalog”
25-Jan 16:37 ducky.unixathome.org-dir JobId 32500: BeforeJob: Can’t get catalog information at /usr/local/share/bacula/make_catalog_backup.pl line 129.
25-Jan 16:37 ducky.unixathome.org-dir JobId 32500: Error: Runscript: BeforeJob returned non-zero status=13. ERR=Child exited with code 13
25-Jan 16:37 ducky.unixathome.org-dir JobId 32500: Error: Bacula ducky.unixathome.org-dir 5.0.0 (26Jan10):
25-Jan-2010 16:37:10

Then I suspect the permissions on make_catalog_backup.pl are insufficient for Bacula to run it. I made mine chown bacula:bacula and chmod 744:

-rwxr-xr-- 1 bacula bacula 4120 Jan 25 17:10 make_catalog_backup.pl

If you see this error:

25-Jan 16:44 ducky.unixathome.org-dir JobId 32502: shell command: run BeforeJob “/usr/local/share/bacula/make_catalog_backup.pl MyCatalog”
25-Jan 16:44 ducky.unixathome.org-dir JobId 32502: BeforeJob: Can’t find your catalog (MyCatalog) in director configuration
25-Jan 16:44 ducky.unixathome.org-dir JobId 32502: Error: Runscript: BeforeJob returned non-zero status=1. ERR=Child exited with code 1

Then chances are the permissions on bacula-dir.conf or dbcheck are insufficient. Make sure this command works:

# su -m bacula -c '/usr/local/sbin/dbcheck -B -c /usr/local/etc/bacula-dir.conf' 
catalog=MyCatalog
db_name=bacula
db_driver=
db_user=bacula
db_password=
db_address=
db_port=0
db_socket=
db_type=PostgreSQL
working_dir=/var/db/bacula

If you get: /usr/local/sbin/dbcheck: Permission denied.

Make sure bacula is allowed to run dbcheck. I use this:

-rwxr-xr-- 1 root bacula 100225 Jan 25 17:12 dbcheck

If you get this, check the permissions on bacula-dir.conf:

26-Jan 01:37 dbcheck: ERROR TERMINATION at parse_conf.c:898 Config error: Cannot open config file “/usr/local/etc/bacula-dir.conf”: Permission denied

I use this:

-rw-r----- 1 root bacula 9095 Jan 25 17:16 bacula-dir.conf

Finally, to be sure, run this command:

su -m bacula -c '/usr/local/share/bacula/make_catalog_backup.pl MyCatalog'

and if that runs fine, Bacula should be able to run it.

Also, if during the backup, you see permission errors on pathhierarchy or pathvisibility then the database upgrade wasn’t run as the correct user. You may have to adjust the owner of the database to match that of
the other tables.

NOTE: This was originally posted to the Bacula users mailing list on 1 January 2010.

  2 Responses to “Bacula – errors with 5.0.0 backup catalog”

  1. Thanks! This actually helped me out alot. The command:
    su -m bacula -c ‘/usr/local/share/bacula/make_catalog_backup.pl MyCatalog’
    helped me find that I had a permissions issue in on of the files included in the director config.

  2. I had similar problems and I have to fix it by putting these permissions:

    >> sudo ls -l /etc/bacula/
    total 36
    -rwxr-x— 1 bacula bacula 3070 may 15 15:59 bacula-dir.conf
    -rwxr-x— 1 bacula bacula 1013 may 10 10:58 bacula-fd.conf
    -rwxr-x— 1 bacula bacula 5949 may 13 12:15 bacula-sd.conf
    -rwxr-x— 1 bacula bacula 192 may 10 10:55 bconsole.conf
    drwxr-x— 2 bacula bacula 4096 may 15 15:59 clientes
    -rwxr-x— 1 bacula bacula 442 may 10 10:57 common_default_passwords
    -rwxr-x— 1 bacula bacula 2060 may 15 13:12 iaaa_messages.conf
    drwxr-x— 2 bacula bacula 4096 may 16 10:48 scripts

    >> sudo ls -l /etc/bacula/scripts
    total 72
    -rwxr-x— 1 bacula bacula 341 sep 8 2012 btraceback.gdb
    -rwxr-x— 1 bacula bacula 112 sep 8 2012 delete_catalog_backup
    -rwxr-x— 1 bacula bacula 10954 sep 8 2012 disk-changer
    -rwxr-x— 1 bacula bacula 16948 sep 8 2012 dvd-handler
    -rwxr-x— 1 bacula bacula 2485 sep 8 2012 make_catalog_backup
    -rwxr-x— 1 bacula bacula 1646 sep 8 2012 make_catalog_backup_awk
    -rwxr-x— 1 bacula bacula 4166 may 16 10:39 make_catalog_backup.pl
    -rwxr-x— 1 bacula bacula 7510 sep 8 2012 mtx-changer
    -rwxr-x— 1 bacula bacula 1506 sep 8 2012 mtx-changer.conf
    -rwxr-x— 1 bacula bacula 256 sep 8 2012 query.sql

    >> sudo ls -l /usr/sbin/dbcheck
    -rwxr-xr-x 1 root root 101976 sep 8 2012 /usr/sbin/dbcheck

    >> sudo ls -l /var/lib/ | grep bacula
    drwx—— 2 bacula bacula 4096 may 16 10:59 bacula

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>