-
Notifications
You must be signed in to change notification settings - Fork 58
/
sd-agent.init
66 lines (59 loc) · 1.52 KB
/
sd-agent.init
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
#!/bin/sh
#
###############################################################################
# sd-agent
#
# Written by Boxed Ice <[email protected]>
# A server monitoring daemon for www.serverdensity.com
#
# Licensed under Simplified BSD License (see LICENSE)
#
###############################################################################
#
# chkconfig: 345 85 15
# description: Server Density Monitoring Agent
AGENTPATH="/usr/bin/sd-agent/agent.py"
[ -f $AGENTPATH ] || echo "/usr/bin/sd-agent not found"
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
fi
if [ -f /etc/SuSE-release ]; then
. /etc/rc.status
rc_reset
fi
# Action to take
case "$1" in
start)
python $AGENTPATH start init
if [ -f /etc/SuSE-release ]; then
rc_status -v
elif [ -f /etc/debian_version ] || [ -f /etc/lsb-release ] || [ -f /etc/gentoo-release ]; then
echo " Started"
else
success
echo
fi
echo
;;
stop)
python $AGENTPATH stop init
if [ -f /etc/SuSE-release ]; then
rc_status -v
elif [ -f /etc/debian_version ] || [ -f /etc/lsb-release ] || [ -f /etc/gentoo-release ]; then
echo " Stopped"
else
success
echo
fi
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/sd-agent start|stop|restart"
exit 1
esac
exit 0