]>
Commit | Line | Data |
---|---|---|
a9223491 | 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 | |
6581695b | 34 | msg_network_down gkrellmd |
a9223491 | 35 | exit 1 |
36 | fi | |
37 | else | |
38 | exit 0 | |
39 | fi | |
40 | ||
41 | ||
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 | |
52 | exit 1 | |
53 | fi | |
54 | ;; | |
55 | stop) | |
56 | if [ -f /var/lock/subsys/gkrellmd ]; then | |
57 | msg_stopping gkrellmd | |
58 | killproc gkrellmd | |
59 | RETVAL=$? | |
60 | rm -f /var/lock/subsys/gkrellmd | |
61 | else | |
62 | msg_not_running gkrellmd | |
63 | exit 1 | |
64 | fi | |
65 | ;; | |
66 | restart) | |
67 | $0 stop | |
68 | $0 start | |
69 | ;; | |
70 | status) | |
71 | status gkrellmd | |
72 | RETVAL=$? | |
73 | ;; | |
74 | *) | |
75 | msg_usage "$0 {start|stop|status|restart}" | |
76 | exit 1 | |
77 | esac | |
78 | ||
79 | exit $RETVAL | |
80 | ||
81 | # This must be last line ! | |
82 | # vi:syntax=sh:tw=78:ts=8:sw=4 |