Running freebsd-7.0

I use a small script in a jail to check if Apache is running and if not, restart it.

#!/bin/sh
#if ps -ax | grep -v grep | grep -i httpd
#then
#    echo "Apache is alive......"
#else
#    echo "Apache is dead, but will be launched."
#/usr/local/etc/rc.d/apache22 start

However, if I want to check the host's Apache, ps -ax sees all of the "httpd" lines including the jail and the host:

(Jail) 83787 ?? SsJ 0:07.71 /usr/local/sbin/httpd -DSSL -DNOHTTPACCEPT
(host) 98089  ??  Ss    32:49.44 /usr/local/sbin/httpd -DNOHTTPACCEPT

How can I modify my script to see only the host based on the bottom line above?

Help appreciated!

Jack




_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to