-
Notifications
You must be signed in to change notification settings - Fork 1
/
subagent-shell.init.rhel
executable file
·73 lines (66 loc) · 1.51 KB
/
subagent-shell.init.rhel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
#
# messagebus: The snmpd subagent
#
# chkconfig: 345 51 49
# description: This is a daemon extend standard snmp functionality with user defined MIB
#
# processname: subagent-shell
# pidfile: /var/run/subagent-shell.pid
#
# Sanity checks.
[ -x /usr/bin/subagent-shell ] || exit 0
[ -f /etc/sysconfig/subagent-shell.options ] && source /etc/sysconfig/subagent-shell.options
RETVAL=0
source /etc/init.d/functions
start() {
echo -n $"Starting snmp subagent shell daemon: "
[ -z "$OPTIONS" ] && OPTIONS="-d -p /var/run/subagent-shell.pid"
daemon /usr/bin/subagent-shell $OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/subagent-shell
echo
return $RETVAL
}
stop() {
echo -n $"Stopping snmp subagent shell daemon: "
killproc /usr/sbin/subagent-shell
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/subagent-shell
echo
return $RETVAL
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/subagent-shell ] && restart
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p /var/run/subagent-shell.pid subagent-shell
RETVAL=$?
;;
restart)
restart
;;
condrestart)
condrestart
;;
reload)
echo "Subagent-shell does not support configuration reload you have to restart it"
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
;;
esac
exit $RETVAL