-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.d-edgy_critsd
executable file
·48 lines (42 loc) · 1.22 KB
/
init.d-edgy_critsd
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
#!/bin/bash
### BEGIN INIT INFO
# Provides: edgy_critsd
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start edgy_critsd at boot time
# Description: start edgy_critsd at boot time
### END INIT INFO
EDGY_CRITS_HOME='/opt/soltra/edge/repository/adapters/crits'
EDGY_CRITSD_BIN='edgy_critsd.py'
PYTHON='/opt/soltra/edge/bin/python2.7'
EDGY_CRITS_USER='repo'
edgy_critsd_start () {
echo "starting edgy_critsd..."
/bin/su ${EDGY_CRITS_USER} -c "cd ${EDGY_CRITS_HOME}/ && ${PYTHON} ${EDGY_CRITS_HOME}/${EDGY_CRITSD_BIN} start"
return 0
}
edgy_critsd_stop () {
echo "stopping edgy_critsd..."
/bin/su ${EDGY_CRITS_USER} -c "cd ${EDGY_CRITS_HOME}/ && ${PYTHON} ${EDGY_CRITS_HOME}/${EDGY_CRITSD_BIN} stop"
}
edgy_critsd_restart () {
echo "restarting edgy_critsd..."
/bin/su ${EDGY_CRITS_USER} -c "cd ${EDGY_CRITS_HOME}/ && ${PYTHON} ${EDGY_CRITS_HOME}/${EDGY_CRITSD_BIN} restart"
}
case "$1" in
start)
edgy_critsd_start
;;
stop)
edgy_critsd_stop
;;
force-reload|restart)
edgy_critsd_restart
;;
*)
echo "Usage: /etc/init.d/edgy_critsd {start|stop|restart|force-reload}"
exit 1
esac
exit 0