]> git.pld-linux.org Git - packages/gkrellm.git/blob - gkrellmd.init
de9421a3204ddfa5eac1c7dca95a51b94c3a0d96
[packages/gkrellm.git] / gkrellmd.init
1 #!/bin/sh
2 #
3 # gkrellmd      gkrellmd - The GNU Krell Monitors Server
4 #
5 # chkconfig:    345 95 10
6 #
7 # description:  gkrellmd Listens for connections from gkrellm clients.  When a  gkrellm
8 #               client connects to a gkrellmd server all builtin monitors collect their
9 #               data from the server.
10 #
11 # processname:  gkrellmd
12 # config:       /etc/gkrellmd.conf
13 # pidfile:      /var/run/gkrellmd.pid
14 #
15 # $Id$
16
17
18 # Source function library
19 . /etc/rc.d/init.d/functions
20
21 # Get network config
22 . /etc/sysconfig/network
23
24 # Set defaults
25 OPTIONS="-d"
26
27 # Get service config - may override defaults
28 [ -f /etc/sysconfig/gkrellmd ] && . /etc/sysconfig/gkrellmd
29
30 # Check that networking is up.
31 if is_yes "${NETWORKING}"; then
32         if [ ! -f /var/lock/subsys/network ]; then
33                 # nls "ERROR: Networking is down. %s can't be run." gkrellmd
34                 msg_network_down gkrellmd
35                 exit 1
36         fi
37 else
38         exit 0
39 fi
40
41 RETVAL=0
42 # See how we were called.
43 case "$1" in
44   start)
45         if [ ! -f /var/lock/subsys/gkrellmd ]; then
46                 msg_starting gkrellmd
47                 daemon gkrellmd $OPTIONS
48                 RETVAL=$?
49                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gkrellmd
50         else
51                 msg_already_running gkrellmd
52         fi
53         ;;
54   stop)
55         if [ -f /var/lock/subsys/gkrellmd ]; then
56                 msg_stopping gkrellmd
57                 killproc gkrellmd
58                 rm -f /var/lock/subsys/gkrellmd
59         else
60                 msg_not_running gkrellmd
61         fi      
62         ;;
63   restart|force-reload)
64         $0 stop
65         $0 start
66         exit $?
67         ;;
68   status)
69         status gkrellmd
70         exit $?
71         ;;
72   *)
73         msg_usage "$0 {start|stop|restart|force-reload|status}"
74         exit 3
75 esac
76
77 exit $RETVAL
78
79 # This must be last line !
80 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.024078 seconds and 2 git commands to generate.