updated on Thu Jan 12 00:00:55 UTC 2012
[aur-mirror.git] / rpc.rstatd / rstatd
blobfd78a472c00be2caebfae9cb20b7a66701325060
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON_NAME=rstatd
7 RSTATD_PID=`pidof -o %PPID /usr/sbin/rpc.rstatd`
8 case "$1" in
9 start)
10 if [ ! -f /var/run/daemons/rpcbind ]; then
11 /etc/rc.d/rpcbind start
12 if [ $? -gt 0 ]; then
13 stat_fail
14 exit 1
17 stat_busy "Starting $DAEMON_NAME"
18 [ -z "$RSTATD_PID" ] && /usr/sbin/rpc.rstatd
19 if [ $? -gt 0 ]; then
20 stat_fail
21 exit 1
22 else
23 echo `pidof -o %PPID /usr/sbin/rpc.rstatd` > /var/run/rpc.rstatd.pid
25 add_daemon $DAEMON_NAME
26 stat_done
29 stop)
30 stat_busy "Stopping $DAEMON_NAME"
31 [ ! -z "$RSTATD_PID" ] && kill $RSTATD_PID &> /dev/null
32 if [ $? -gt 0 ]; then
33 stat_fail
34 exit 1
35 else
36 rm /var/run/rpc.rstatd.pid &> /dev/null
38 rm_daemon $DAEMON_NAME
39 stat_done
42 restart)
43 $0 stop
44 sleep 2
45 $0 start
49 echo "usage: $0 {start|stop|restart}"
50 esac
51 exit 0