WildWayz
01-06-2002, 03:14 AM
Hi ya,
I have a server with Cpanel on it, but at about the same time every day the bind and/or apache crashes and I have to restart them.
I think this is about the time Cpanel tries to update itself - but it never restarts afterwards.
Anyway to get a script that checks if the services are up every Xmins and restart it if it comes across a failure?
For the moment, I am going to try and disable the cron job for updating cpanel in the night.
James
BurstNET
01-06-2002, 03:37 AM
make sure chkservd is running
/etc/rc.d/init.d/chkservd
checks bind and httpd services and restarts if need be...
Sean R.
BurstNET
WildWayz
01-06-2002, 03:43 AM
/etc/rc.d/init.d/chkservd status detects it as running.
Whenever it fails it never restarts though :/
Weird :/
I also get floods of 'lamer server' errors in my logs too some pointing to DarkOrb.net.
--James
Check your apache logs, and look for entries like wierd characters. It might be hack attempts or wrong activity. This happened to me also.
bobcares
01-06-2002, 12:20 PM
Hi!
Try to run what cron tries to do manually and see what happens. This would help you dedect why the auto restart is not taking place.
More important check the logs and see the conf files for httpd. and named to see what is wrong. After all these things don't just die..
have a great day :)
regards
amar
WildWayz
01-06-2002, 12:37 PM
The cron is a little weird - sometimes it works, other times it doesn't
I do it like this...
/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/named restart
/etc/rc.d/init.d/httpd start
Sometimes I get
/etc/rc.d/init.d/httpd stop: httpd stopped
Stopping named: [ OK ]
Starting named: [ OK ]
/etc/rc.d/init.d/httpd start: httpd started
Other times
/etc/rc.d/init.d/httpd stop: httpd stopped
Stopping named: [ FAILED ]
Starting named: [ OK ]
/etc/rc.d/init.d/httpd start: httpd started
or
/etc/rc.d/init.d/httpd stop: httpd stopped
Stopping named: [ OK ]
Starting named: [ OK ]
/etc/rc.d/init.d/httpd start: already started
or similar.
If I get a failed at all, then server is down for 15mins until the next cron is run.
--James
bobcares
01-06-2002, 01:15 PM
Did you check the logs and see anything unusual.
Have a great day :)
regards
amar
WildWayz
01-06-2002, 01:17 PM
What logs are they?
/use/local/apache/logs/error_log ?
or PortSentry logs that are emailed to me?
--James
bobcares
01-06-2002, 01:23 PM
One you must check the apache log. Also go to /var/log and see the messages and other files.
I hope this helps.
have a great day :)
regards
amar
WildWayz
01-06-2002, 01:34 PM
Hmmm I scouted around there and tail/grepped the files for named/httpd and there wasn't anything unusual listed.
I know I get a few hack attempts every day from people on wandaloo.fr which I am constantly reporting to wandaloo
Plus I get people trying to log in anonymously - but I disabled anonymous ftp.
--James
Check the error_log and the acccess_log in the apache/logs dir.