From dd6c3f1cd639cd5c29ea75909eff5f435701815e Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 23 Feb 2010 14:53:38 +0100 Subject: [PATCH] Use db_socket parameter in make_catalog_backup_.pl script --- bacula/src/cats/make_catalog_backup.pl.in | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bacula/src/cats/make_catalog_backup.pl.in b/bacula/src/cats/make_catalog_backup.pl.in index f1e00e8ea0..bc606e8d57 100644 --- a/bacula/src/cats/make_catalog_backup.pl.in +++ b/bacula/src/cats/make_catalog_backup.pl.in @@ -14,7 +14,7 @@ use strict; Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -74,6 +74,9 @@ sub dump_pgsql if ($args{db_address}) { $ENV{PGHOST}=$args{db_address}; } + if ($args{db_socket}) { + $ENV{PGHOST}=$args{db_socket}; + } if ($args{db_port}) { $ENV{PGPORT}=$args{db_port}; } @@ -93,9 +96,15 @@ sub dump_mysql unlink("$wd/.my.cnf"); open(MY, ">$wd/.my.cnf") or die "Can't open $wd/.my.cnf for writing $@"; + $args{db_address} = $args{db_address} || "localhost"; + my $addr = "host=$args{db_address}"; + if ($args{db_socket}) { # unix socket is fastest than net socket + $addr = "socket=$args{db_socket}"; + } + print MY "[client] -host=$args{db_address} +$addr user=$args{db_user} password=$args{db_password} "; -- 2.39.5