Changeset e5d09e81c6b6816e904b241f852e542e067c2d4c

Show
Ignore:
Timestamp:
03/22/07 18:03:57 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1174586637 +0000
git-parent:

[d1c88304cad0718a35367b4e5068e687459d1665]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1174586637 +0000
Message:

shm status support

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • resmon

    rc203f3d re5d09e8  
    88use Getopt::Long; 
    99use Data::Dumper; 
    10 use vars qw($config_file $debug $status_file $config); 
     10use vars qw($config_file $debug $status_file $interface $port $config); 
    1111 
    1212use Resmon::Config; 
     
    1616 
    1717GetOptions( 
     18  "i=s" => \$interface, 
     19  "p=i" => \$port, 
    1820  "c=s" => \$config_file, 
    1921  "d"   => \$debug, 
     
    2729  $config = Resmon::Config->new($config_file); 
    2830  $config->{statusfile} = $status_file if($status_file); 
    29   print Dumper($config) if($debug); 
    3031} 
    3132 
    3233$SIG{'HUP'} = \&configure; 
    3334configure(); 
    34  
    35 unless($debug) { 
    36   fork && exit; 
    37   setsid; 
    38   close(STDIN); 
    39   close(STDOUT); 
    40   close(STDERR); 
    41   fork && exit; 
    42 } 
    4335 
    4436my $sigint = 0; 
     
    5850my $list = []; 
    5951my $status = Resmon::Status->new($config->{statusfile}); 
     52$status->open(); 
     53$status->serve_http_on($interface, $port) if($port); 
     54 
     55unless($debug) { 
     56  fork && exit; 
     57  setsid; 
     58  close(STDIN); 
     59  close(STDOUT); 
     60  close(STDERR); 
     61  fork && exit; 
     62} 
     63 
    6064while(1) { 
    6165  while(my($module_name, $mod_configs) = each %{$config->{Module}}) {