]>
Commit | Line | Data |
---|---|---|
95d0617b ER |
1 | #!/bin/sh |
2 | # | |
3 | # cf-monitord: Starts the GNU cfengine environment daemon | |
4 | # | |
5 | # chkconfig: - 15 85 | |
6 | # description: This process maintains state information about the client | |
7 | # machine's environment (network status, running processes, load, disk | |
8 | # usage, etc.). This data is made available as classes that can be used | |
9 | # in the agent configuration file to regulate activity based on the system's | |
10 | # deviation from what has been measured over a long period of time | |
11 | # (2 months or more) to be normal or average activity. | |
12 | # | |
13 | # processname: cf-monitord | |
14 | # | |
15 | ||
16 | # Source function library. | |
17 | . /etc/rc.d/init.d/functions | |
18 | ||
19 | exec="/usr/sbin/cf-monitord" | |
20 | prog=$(basename $exec) | |
21 | ||
22 | [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog | |
23 | ||
24 | lockfile=/var/lock/subsys/$prog | |
25 | ||
26 | start() { | |
27 | echo -n $"Starting GNU cfengine environmental history daemon: " | |
28 | daemon $prog | |
29 | RETVAL=$? | |
30 | echo | |
31 | [ $RETVAL -eq 0 ] && touch $lockfile | |
32 | } | |
33 | ||
34 | stop() { | |
35 | echo -n $"Stopping GNU cfengine environmental history daemon: " | |
36 | killproc $exec | |
37 | RETVAL=$? | |
38 | echo | |
39 | [ $RETVAL -eq 0 ] && rm -f $lockfile | |
40 | return $RETVAL | |
41 | } | |
42 | ||
43 | restart() { | |
44 | stop | |
45 | start | |
46 | } | |
47 | ||
48 | reload() { | |
49 | restart | |
50 | } | |
51 | ||
52 | force_reload() { | |
53 | restart | |
54 | } | |
55 | ||
56 | fdrstatus() { | |
57 | status $prog | |
58 | } | |
59 | ||
60 | case "$1" in | |
61 | start|stop|restart|reload) | |
62 | $1 | |
63 | ;; | |
64 | force-reload) | |
65 | force_reload | |
66 | ;; | |
67 | status) | |
68 | fdrstatus | |
69 | ;; | |
70 | condrestart) | |
71 | [ ! -f $lockfile ] || restart | |
72 | ;; | |
73 | *) | |
74 | echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}" | |
75 | exit 3 | |
76 | esac | |
77 | exit $? | |
78 |