forked from irods-contrib/metalnx-rmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rmd.centos
57 lines (51 loc) · 1.01 KB
/
rmd.centos
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
#
# rmd Startup script for the Remote Monitoring Service
#
# chkconfig: - 85 15
# description: The Apache HTTP Server is an efficient and extensible \
# server implementing the current HTTP standards.
# processname: rmd
# config: /etc/rmd/rmd.conf
# pidfile: /var/run/rmd.pid
# Source function library.
. /etc/rc.d/init.d/functions
rmdctl=/opt/rmd/main.py
prog=RMD
pidfile=/var/run/rmd.pid
lockfile=/var/lock/subsys/rmd.lock
RETVAL=0
start() {
echo -n $"Starting $prog: "
daemon --pidfile $pidfile python $rmdctl start $pidfile
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile}
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status -p $pidfile && exit 0 || exit $?
;;
*)
echo $"Usage: $prog {start|stop|restart|status}"
RETVAL=2
esac
exit $RETVAL