Fri Aug 20 18:03:53 PDT 2004
- Previous message: [Slony1-commit] By darcyb: Make the AIX build a bit cleaner
- Next message: [Slony1-commit] By cbbrowne: Add support for Apache "rotatelogs"; if you specify a path
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Log Message: ----------- This addresses two bugs: 1. ps_args() wasn't picking up OS names correctly because the shell command included an EOL. Chomp the output and it works. 2. get_pid() was adversely affected by 1, as well as by two other "buglets:" - it didn't cope properly when command options came between "slon" and the cluster name - the loop that was rummaging through PS output was trashing the $pid in the final iteration before returning it This addresses various erroneous error messages being generated by slon_kill.pl and slon_start.pl Modified Files: -------------- slony1-engine/tools/altperl: slon-tools.pm (r1.4 -> r1.5) -------------- next part -------------- Index: slon-tools.pm =================================================================== RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon-tools.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -Ltools/altperl/slon-tools.pm -Ltools/altperl/slon-tools.pm -u -w -r1.4 -r1.5 --- tools/altperl/slon-tools.pm +++ tools/altperl/slon-tools.pm @@ -81,6 +81,7 @@ open(OUT, ">>$LOGDIR/slonik_scripts.log"); my $now = `date`; chomp $now; + print OUT "/* ------------------------------------------------------------- */\n"; print OUT "/* Script: $script submitted at $now */\n"; print OUT "/* ------------------------------------------------------------- */\n"; close OUT; @@ -91,6 +92,7 @@ sub ps_args { my $sys=`uname`; + chomp $sys; # Strip off cruft if ($sys eq "Linux") { return "/bin/ps -auxww"; } elsif ($sys eq "FreeBSD") { @@ -107,15 +109,16 @@ my ($node) = @_; $node =~ /node(\d*)$/; my $nodenum = $1; - my $pid; + my ($retpid, $pid); my ($dbname, $dbport, $dbhost) = ($DBNAME[$nodenum], $PORT[$nodenum], $HOST[$nodenum]); # print "Searching for PID for $dbname on port $dbport\n"; - open(PSOUT, ps_args() . "| egrep \"[s]lon $SETNAME\" | egrep \"host=$dbhost dbname=$dbname.*port=$dbport\" | sort -n | awk '{print \$2}'|"); + open(PSOUT, ps_args() . "| egrep \"[s]lon .*$SETNAME\" | egrep \"host=$dbhost dbname=$dbname.*port=$dbport\" | sort -n | awk '{print \$2}'|"); while ($pid = <PSOUT>) { - chop $pid; + chomp $pid; + $retpid = $pid; } close(PSOUT); - return $pid; + return $retpid; } sub start_slon {
- Previous message: [Slony1-commit] By darcyb: Make the AIX build a bit cleaner
- Next message: [Slony1-commit] By cbbrowne: Add support for Apache "rotatelogs"; if you specify a path
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-commit mailing list