Changeset 22ac6469b995e21fe0bd0d3f0c1aa0bf567ac6ed

Show
Ignore:
Timestamp:
06/30/08 19:55:47 (6 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1214855747 +0000
git-parent:

[2d605730b358ee1e0a09356c06aad13e1696b839]

git-author:
Mark Harrison <mark@omniti.com> 1214855747 +0000
Message:

Added an UPDATE module to update resmon automatically. Made some modifications
to the update script to support this change.

git-svn-id: https://labs.omniti.com/resmon/trunk@134 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • update/update.pl

    r597725e r22ac646  
    3535 
    3636my $resmondir='/opt/resmon'; 
     37# Debug mode. WARNING: turning this on will reload resmon on every invocation 
     38# regardless of whether there were any files updated or not. This is 
     39# incompatible with the UPDATE resmon module which will constantly reload as 
     40# soon as an update is found. 
    3741my $debug = 0; 
    3842 
     
    4852if (!$svn) { 
    4953    print STDERR "Cannot find subversion. Exiting.\n"; 
    50     exit -1
     54    exit 2
    5155} 
    5256 
     
    128132    my $handle = IO::Socket::INET->new(Proto     => "tcp", 
    129133                                    PeerAddr  => $host, 
    130                                     PeerPort  => $port) 
    131            or die "can't connect to port $port on $host: $!"; 
     134                                    PeerPort  => $port); 
     135    if (!$handle) { 
     136        print STDERR "can't connect to port $port on $host: $!"; 
     137        return 0; 
     138    } 
    132139 
    133140    print $handle "GET /RESMON/resmon HTTP/1.0\n\n"; 
     
    172179        `$svn update -r $last_rev $resmondir`; 
    173180        reload_resmon(); 
     181        exit 3; 
    174182    } 
     183    exit 1; 
    175184}