Bacula-users

Re: [Bacula-users] Perl 5.20 upgrade breaks make_catalog_backup.pl?

2015-06-04 03:22:04
Subject: Re: [Bacula-users] Perl 5.20 upgrade breaks make_catalog_backup.pl?
From: Eric Bollengier <eric.bollengier AT baculasystems DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Thu, 04 Jun 2015 09:01:11 +0200
Hello Doug,

On 06/02/2015 09:01 PM, Doug Sampson wrote:
> Recently FreeBSD announced that its default Perl version is now 5.20 and
> urged all users to upgrade to that version. I did so. Now
> make_catalog_backup.pl doesn’t run. The first indication was as follows:
> 
>  
> 
> 30-May 09:05 pisces-dir JobId 15770: shell command: run BeforeJob
> "/usr/local/share/bacula/make_catalog_backup1.pl MyCatalog"
> 
> 30-May 09:05 pisces-dir JobId 15770: BeforeJob: Statement unlikely to be
> reached at /usr/local/share/bacula/make_catalog_backup1.pl line 40.
> 
> 30-May 09:05 pisces-dir JobId 15770: BeforeJob:       (Maybe you meant
> system() when you said exec()?)

This first warning message is a bit strange, the code is doing:

sub dump_pgsql
{
    my %args = @_;
    setup_env_pgsql(%args);
    exec("HOME='$wd' pg_dump -c > '$wd/$args{db_name}.sql'");
    print "Error while executing postgres dump $!\n";
    return 1;               # in case of error
}

The code after the exec is supposed to handle the case where exec()
doesn't work. Can you try to replace function by

sub dump_pgsql
{
    my %args = @_;
    setup_env_pgsql(%args);
    exec("HOME='$wd' pg_dump -c > '$wd/$args{db_name}.sql'")
       or die "Error while executing postgres dump $!\n";
}

to see if the warning is fixed.


> 30-May 09:05 pisces-dir JobId 15770: BeforeJob: cannot create
> /backup/bacula.sql: Permission denied
> 
> 30-May 09:05 pisces-dir JobId 15770: Error: Runscript: BeforeJob
> returned non-zero status=2. ERR=Child exited with code 2

Here you have the real error
"cannot create /backup/bacula.sql: Permission denied"

Maybe you can change permissions on /backup to allow "bacula" to create
files.


Best Regards,
Eric

-- 
Need professional help and support for Bacula ?
Visit http://www.baculasystems.com

------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users