]> git.pld-linux.org Git - packages/mathopd.git/blob - mathopd.init
Release 6 (by relup.sh)
[packages/mathopd.git] / mathopd.init
1 #!/bin/bash
2 #
3 # mathopd       Tiny/turbo http daemon
4 #
5 # chkconfig:    2345 95 01
6 # description:  mathopd
7 # processname:  mathopd
8 # pidfile:      /var/run/mathopd.pid
9 # config:       /etc/mathopd.conf
10
11 # Source function library
12 . /etc/rc.d/init.d/functions
13
14 # Get network config
15 . /etc/sysconfig/network
16
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
21                 exit 1
22         fi
23 else
24         exit 0
25 fi
26
27 # Get service config
28 [ -f /etc/sysconfig/mathopd ] && . /etc/sysconfig/mathopd
29
30 RETVAL=0
31 # See how we were called.
32 case "$1" in
33   start)
34         # Check if the service is already running?
35         if [ ! -f /var/lock/subsys/mathopd ]; then
36                 msg_starting mathopd
37                 touch /var/run/mathopd.pid
38                 chown http.http /var/run/mathopd.pid
39                 daemon /usr/sbin/mathopd -f /etc/mathopd.conf
40                 RETVAL=$?
41                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mathopd
42         else
43                 msg_already_running mathopd
44         fi
45         ;;
46   stop)
47         # Stop daemons.
48         if [ -f /var/lock/subsys/mathopd ]; then
49                 msg_stopping mathopd
50                 killproc mathopd
51                 rm -f /var/lock/subsys/mathopd /var/run/mathopd.pid /var/run/mathopd.loc* >/dev/null 2>&1
52         else
53                 msg_not_running mathopd
54         fi
55         ;;
56   status)
57         status mathopd
58         exit $?
59         ;;
60   restart|force-reload)
61         $0 stop
62         $0 start
63         exit $?
64         ;;
65   *)
66         msg_usage "$0 {start|stop|restart|force-reload|status}"
67         exit 3
68 esac
69
70 exit $RETVAL
This page took 0.03403 seconds and 3 git commands to generate.