I've seen that many scripts in /sbin/init.d (don't know if all of them), have the "status" option. So you can trap those "OK" or "up" messages, meaning the service is working. --- sample --- # check for the lpd service to stay working... LPDSTATUS=`/sbin/init.d/lpd status | grep -c -e "OK" -e "up"` [ $LPDSTATUS -eq 0 ] && /sbin/init.d/lpd start --- end --- Hope this helps... - Nestor On Wed, 23 Feb 2000, Rogier Maas wrote:
Hi,
I would like to have a cronjob running each hour checking on my critical services (httpd, inetd, etc). If one of 'em isn't running, it has to be started.
Does anybody know how to do that? I can imagine something like ps aux|grep <string>|test, but then my knowledge of pipeing and shellcommands stop...
Thanks,
Rogier
+---------------------------------+ | Rogier Maas | | icarus@guldennet.nl | | http://www.guldennet.nl~icarus/ | | ICQ# 2403780 | +---------------------------------+
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/