10 |
use CouchDB; |
use CouchDB; |
11 |
|
|
12 |
our $pids; |
our $pids; |
13 |
$pids = { httpd => $$, kvm => 'not started' } unless defined $pids; # keep pids on refresh |
$pids = { |
14 |
|
httpd => $$, |
15 |
|
kvm => 'not started', |
16 |
|
wireshark => 'not started', |
17 |
|
} unless defined $pids; # keep pids on refresh |
18 |
|
|
19 |
sub DESTROY { |
sub DESTROY { |
20 |
warn "pids ",dump( $pids ); |
warn "pids ",dump( $pids ); |
36 |
my $daemon = shift; |
my $daemon = shift; |
37 |
|
|
38 |
my $pid = $pids->{$daemon}; |
my $pid = $pids->{$daemon}; |
39 |
my $pid_path = "$server::conf/$daemon.pid"; |
my $pid_path = "$daemon.pid"; |
40 |
|
$pid_path =~ s{/}{-}g; |
41 |
|
$pid_path = "$server::conf/$pid_path"; |
42 |
|
|
43 |
if ( ! $pid && -e $pid_path ) { |
if ( ! $pid && -e $pid_path ) { |
44 |
my $p = read_file $pid_path; |
my $p = read_file $pid_path; |