[BlueOnyx:09412] Re: admin errors python
Steffan
general at ziggo.nl
Tue Jan 17 06:18:51 -05 2012
Well the problem seems to be denyhosts
python /usr/bin/denyhosts.py --daemon --config=/etc/denyhosts.cfg
-----Oorspronkelijk bericht-----
Van: blueonyx-bounces at mail.blueonyx.it
[mailto:blueonyx-bounces at mail.blueonyx.it] Namens Ken - Precision Web
Hosting, Inc
Verzonden: donderdag 12 januari 2012 20:07
Aan: BlueOnyx General Mailing List
Onderwerp: [BlueOnyx:09376] Re: admin errors python
----- Original Message -----
From: Steffan
It happens many times that on several servers the siteadmin cant be reached
Restarting admserv gives a error on port 81
Python is taking port 81
So killing it will restart admserv but why happens this
And what to do to resolve this
tcp 0 0 :::81 :::*
LISTEN 27657/python
With regards
Steffan
<<
Steffan
Below is the script I run every few minutes.
It checks the admserv and restarts if necessary.
It also checks to see if port 444 is taken and kills any processes using
that port.
It could be modified to also check and kill processes that steal port 81.
#!/usr/bin/perl
##################################################################
# checks the admserv if necessary
$running = "no";
$processtokill = "nothing";
$pscount =`ps auxwwwww | grep httpd | grep admsrv | grep -v grep | grep -v
defunct -c `;
if ( $pscount > 1 ) {
$running = "yes";
}
if ($running eq "no") {
print "admserv problem - restart it \n";
system ("/etc/rc.d/init.d/admserv stop");
sleep (5);
$fuser =`/sbin/fuser 444/tcp`;
chomp ($fuser);
($prev0, $processtokill) = split(/tcp:/,$fuser);
print "The /fuser of 444 is $fuser \n";
if ($processtokill =~ /\d/){
system ("kill -9 $processtokill");
print "I killed $processtokill \n";
}
system ("/etc/rc.d/init.d/admserv start");
print "The ps is $aps \n";
print "The /fuser of 444 is $fuser \n";
print "444 process $processtokill \n";
system ("touch $filename");
}
?
#############################################
?
?
----
Ken Marcus
Precision Web Hosting, Inc.
http://www.precisionweb.net
_______________________________________________
Blueonyx mailing list
Blueonyx at mail.blueonyx.it
http://mail.blueonyx.it/mailman/listinfo/blueonyx
More information about the Blueonyx
mailing list