Allow the piddir to be overidden at the bucardorc level
authorGreg Sabino Mullane <greg@endpoint.com>
Thu, 12 Jun 2014 16:04:42 +0000 (12:04 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Thu, 12 Jun 2014 16:04:42 +0000 (12:04 -0400)
bucardo

diff --git a/bucardo b/bucardo
index cc482bf4d424ae04f6a52a23f4b37ff6a0e94fb4..ed7e73a952d490096497e78dff68225c8243df32 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -168,6 +168,7 @@ GetOptions ## no critic (ProhibitCallsToUndeclaredSubs)
      'logseparate|log-sep|log-separate|debugfilesep!',
      'logextension|log-extension|log-ext|debugname=s',
      'logclean|log-clean!',
+     'piddir=s',
 
      ## Used internally
      'force',
@@ -300,7 +301,7 @@ my $REASONFILE = get_config('reason_file') or die "Invalid reason_file!\n";
 (my $REASONFILE_LOG = $REASONFILE) =~ s{(?:[.][^.]+)?$}{.log};
 
 ## The directory Bucardo.pm writes PID and other information to
-my $PIDDIR = get_config('piddir') or die "Invalid piddir!\n";
+my $PIDDIR = $bcargs->{piddir} || get_config('piddir') or die "Invalid piddir!\n";
 
 ## The PID file of the master control file (MCP)
 ## If this exists, it is a good bet that Bucardo is currently running