]>
Commit | Line | Data |
---|---|---|
a9223491 | 1 | #!/bin/sh |
2 | # | |
3 | # gkrellmd gkrellmd - The GNU Krell Monitors Server | |
4 | # | |
5 | # chkconfig: 345 95 10 | |
6 | # | |
6fe36520 | 7 | # description: gkrellmd Listens for connections from gkrellm clients. When a gkrellm \ |
8 | # client connects to a gkrellmd server all builtin monitors collect their \ | |
a9223491 | 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 | |
082e7660 | 32 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
a9223491 | 33 | # nls "ERROR: Networking is down. %s can't be run." gkrellmd |
6581695b | 34 | msg_network_down gkrellmd |
a9223491 | 35 | exit 1 |
36 | fi | |
37 | else | |
38 | exit 0 | |
39 | fi | |
40 | ||
51a0db10 | 41 | RETVAL=0 |
a9223491 | 42 | # See how we were called. |
43 | case "$1" in | |
44 | start) | |
45 | if [ ! -f /var/lock/subsys/gkrellmd ]; then | |
46 | msg_starting gkrellmd | |
6581695b | 47 | daemon gkrellmd $OPTIONS |
a9223491 | 48 | RETVAL=$? |
49 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gkrellmd | |
50 | else | |
51 | msg_already_running gkrellmd | |
a9223491 | 52 | fi |
53 | ;; | |
54 | stop) | |
55 | if [ -f /var/lock/subsys/gkrellmd ]; then | |
56 | msg_stopping gkrellmd | |
57 | killproc gkrellmd | |
a9223491 | 58 | rm -f /var/lock/subsys/gkrellmd |
59 | else | |
60 | msg_not_running gkrellmd | |
a9223491 | 61 | fi |
62 | ;; | |
51a0db10 | 63 | restart|force-reload) |
a9223491 | 64 | $0 stop |
65 | $0 start | |
51a0db10 | 66 | exit $? |
a9223491 | 67 | ;; |
68 | status) | |
69 | status gkrellmd | |
51a0db10 | 70 | exit $? |
a9223491 | 71 | ;; |
72 | *) | |
51a0db10 | 73 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
74 | exit 3 | |
a9223491 | 75 | esac |
76 | ||
77 | exit $RETVAL | |
78 | ||
79 | # This must be last line ! | |
80 | # vi:syntax=sh:tw=78:ts=8:sw=4 |