3 # mathopd Tiny/turbo http daemon
5 # chkconfig: 2345 95 01
8 # pidfile: /var/run/mathopd.pid
9 # config: /etc/mathopd.conf
11 # Source function library
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down mathopd
28 [ -f /etc/sysconfig/mathopd ] && . /etc/sysconfig/mathopd
31 # See how we were called.
34 # Check if the service is already running?
35 if [ ! -f /var/lock/subsys/mathopd ]; then
37 touch /var/run/mathopd.pid
38 chown http.http /var/run/mathopd.pid
39 daemon /usr/sbin/mathopd -f /etc/mathopd.conf
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mathopd
43 msg_already_running mathopd
48 if [ -f /var/lock/subsys/mathopd ]; then
51 rm -f /var/lock/subsys/mathopd /var/run/mathopd.pid /var/run/mathopd.loc* >/dev/null 2>&1
53 msg_not_running mathopd
66 msg_usage "$0 {start|stop|restart|force-reload|status}"