Change default reason_file name to end in .txt.
authorDavid E. Wheeler <david@justatheory.com>
Tue, 16 Oct 2012 23:47:00 +0000 (16:47 -0700)
committerDavid E. Wheeler <david@justatheory.com>
Tue, 16 Oct 2012 23:47:00 +0000 (16:47 -0700)
Because it is not a log file, only the most reason reason is written
to it.

But also modify the rason log file to replace the extension from the reason
file with `.log`. So it should no longer be named
`bucardo.restart.reason.log.log` by default.

In other words, the names are:

Reason File: `bucardo.restart.reason.txt`
Rason Log:   `bucardo.restart.reason.log`.

Closes GitHub issue #9.

bucardo
bucardo.schema

diff --git a/bucardo b/bucardo
index 525749594050e48e9b82c73a4999ea3c9b71de61..c7b77cb0e8d39b401a3ef81ed99a0a178611a093 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -257,7 +257,7 @@ $dbh->commit();
 my $REASONFILE = "$bcargs->{debugdir}/" . do {
     get_config('reason_file') or die "Invalid reason_file!\n"
 };
-my $REASONFILE_LOG = "$REASONFILE.log";
+(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";
@@ -9286,8 +9286,10 @@ Usage: ./bucardo start "Reason --name"
 
 Restarts Bucardo cleanly by first issuing the equivalent of a stop to ask any existing Bucardo
 processes to exit, and then starting a new Bucardo MCP process. A short reason and name should
-be provided - these are logged in the C<reason_file> file in the C<debudir> and sent in the
-email sent when Bucardo has been started up.
+be provided - these are written to the C<reason_file> file (F<bucardo.restart.reason.txt> by
+default) in the C<debudir> and sent in the email sent when Bucardo has been started up. It is
+also appended to the reason log, which has the same name as the the C<reason_file> but ends in
+F<.log>.
 
 Before attempting to kill any old processes, a ping command with a timeout of 5 seconds is issued.
 If this returns successfully (indicating an active MCP process already running), the script will
@@ -9302,8 +9304,10 @@ detect and cause them to exit. Note that active syncs will not exit right away,
 will not look for the stop file until they have finished their current run. Typically,
 you should scan the list of processes after running this program to make sure that all Bucardo
 processes have stopped. One should also provide a reason for issuing the stop - usually
-this is a short explanation and your name. This is logged in the C<reason_file> file in the
-C<debugdir> and is also used by Bucardo when it exits and sends out mail about its death.
+this is a short explanation and your name. This is written to the C<reason_file> file
+(F<bucardo.restart.reason.txt> by default) in the C<debugdir> and is also used by Bucardo when
+it exits and sends out mail about its death. It is also appended to the reason log, which has
+the same name as the the C<reason_file> but ends in F<.log>.
 
 =item B<list>
 
index 27c1b6c5dcae33f653fbdacaf5a899bd0e634f1a..5fde00dd858698771029d315b116b72b64656982 100644 (file)
@@ -161,7 +161,7 @@ email_debug_file||File to save a copy of all outgoing emails to
 flatfile_dir|.|Directory to store the flatfile output inside of
 host_safety_check||Regex to make sure we don't accidentally run where we should not
 piddir|/var/run/bucardo|Directory holding Bucardo PID files
-reason_file|bucardo.restart.reason.log|File to hold reasons for stopping and starting
+reason_file|bucardo.restart.reason.txt|File to hold reasons for stopping and starting
 semaphore_table|bucardo_status|Table to let apps know a sync is ongoing
 statement_chunk_size|10000|How many primary keys to shove into a single statement
 stats_script_url|http://www.bucardo.org/|Location of the stats script