#! /usr/local/bin/perl # # Watch over if the httpd is still alive ! # # $version="1.0.0"; # # (c) 1998 Emmanuel PIERRE # epierre@mail.esiea.fr # http://www.esiea.fr/public_html/Emmanuel.PIERRE # # open(IN,"/usr/people/web/logs/httpd.pid"); $apachepid=; chomp($apachepid); close(IN); #print $apachepid; $alive=0; open(TEST,"ps -auxj |"); while () { ($pere,$monid) = ($_ =~ /\s+(\d+)\s+(\d+).*/); if (($monid eq $apachepid) && ($pere eq "1")) { $alive=1; } } if ($alive==0) { #print "-$apachepid- Dead\n"; system("/usr/people/web/bin/httpd.init start"); }# else {print "Alive\n";}