version 1.8, 2003/07/01 19:57:45
|
version 1.10, 2005/02/14 00:18:03
|
Line 61 $pidfile="/home/httpd/perl/logs/lonhttpd
|
Line 61 $pidfile="/home/httpd/perl/logs/lonhttpd
|
|
|
if (-e $pidfile) { |
if (-e $pidfile) { |
open(LFH,"$pidfile"); |
open(LFH,"$pidfile"); |
my $pide=<$LFH>; |
my $pide=<LFH>; |
chomp($pide); |
chomp($pide); |
close(LFH); |
close(LFH); |
if (kill 0 => $pide) { die "already running"; } |
if (kill 0 => $pide) { die "already running"; } |
Line 260 EOF
|
Line 260 EOF
|
} |
} |
|
|
|
|
sub bye { unlink($pidfile); exit; } |
sub bye { exit; } |
|
|
|
sub goodbye { unlink($pidfile); exit; } |
|
|
sub dead { |
sub dead { |
&htsponse(500, "Server Error"); |
&htsponse(500, "Server Error"); |
Line 276 EOF
|
Line 278 EOF
|
} |
} |
|
|
$SIG{'__DIE__'} = \&dead; |
$SIG{'__DIE__'} = \&dead; |
$SIG{'ALRM'} = $SIG{'TERM'} = $SIG{'INT'} = \&bye; |
$SIG{'ALRM'} = \&bye; |
|
$SIG{'TERM'} = $SIG{'INT'} = \&goodbye; |
|
|
sub master { |
sub master { |
$0 = "lonhttpd: (dhttpi) handling request"; |
$0 = "lonhttpd: (dhttpi) handling request"; |