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.
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};
}
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}
";