forked from irods-contrib/metalnx-rmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rmd.debian
57 lines (50 loc) · 1.08 KB
/
rmd.debian
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
#!/bin/bash
### BEGIN INIT INFO
# Provides: rmd
# Default-Start: 2
# Default-Stop:
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Short-Description: EMC Orion Remote Monitoring Daemon
### END INIT INFO
# Source function library.
. /lib/lsb/init-functions
rmdctl=/usr/local/rmd/main.py
prog=RMD
pidfile=/var/run/rmd.pid
lockfile=/var/lock/rmd.lock
RETVAL=0
start() {
log_daemon_msg "Starting EMC Orion RMD" "rmd" || true
start_daemon -p $pidfile /usr/bin/python $rmdctl start $pidfile
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}
stop() {
log_daemon_msg "Stopping EMC Orion RMD" "rmd" || true
killproc -p ${pidfile} /usr/bin/python
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status_of_proc -p $pidfile /usr/bin/python "RMD"
;;
*)
echo $"Usage: $prog {start|stop|restart|status}"
RETVAL=2
esac
exit $RETVAL