/[rserv]/bin/SlaveInit
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /bin/SlaveInit

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by dpavlin, Fri Aug 15 23:00:12 2003 UTC revision 1.7 by dpavlin, Thu Oct 30 19:59:48 2003 UTC
# Line 9  eval '(exit $?0)' && eval 'exec perl -S Line 9  eval '(exit $?0)' && eval 'exec perl -S
9  use strict;  use strict;
10  use Pg;  use Pg;
11  use Getopt::Long;  use Getopt::Long;
 use Sys::Hostname;  
12    
13  $| = 1;  $| = 1;
14    
# Line 94  if ($mconn->status != PGRES_CONNECTION_O Line 93  if ($mconn->status != PGRES_CONNECTION_O
93  #    exit 1;  #    exit 1;
94  }  }
95    
96  my $host = defined($slavehost) ? $slavehost : hostname;  $slavehost="localhost" if (! $slavehost);
97    
98  $result = $mconn->exec("INSERT INTO _RSERV_SERVERS_ (host,dbase) VALUES ('$host','$slave')");  $result = $mconn->exec("INSERT INTO _RSERV_SERVERS_ (host,dbase) VALUES ('$slavehost','$slave')");
99  if ($result->resultStatus ne PGRES_COMMAND_OK) {  if ($result->resultStatus ne PGRES_COMMAND_OK) {
100      print STDERR $mconn->errorMessage;      print STDERR $mconn->errorMessage;
101      RollbackAndQuit($conn) if ($result->resultStatus ne PGRES_COMMAND_OK);      RollbackAndQuit($conn) if ($result->resultStatus ne PGRES_COMMAND_OK);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.26