updated on Sun Jan 15 20:01:04 UTC 2012
[aur-mirror.git] / sfs / sfssd
blob2ee9642d3432ef3fe252d5c64ec50af1d035e95c
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON_NAME=sfssd
7 SFSSD_PID=`pidof -o %PPID sfssd`
8 case "$1" in
9 start)
10 stat_busy "Starting $DAEMON_NAME"
11 if [ ! -f /var/run/daemons/portmap ]; then
12 echo "ERROR: portmap is not running"
13 stat_fail
14 exit 1
16 if [ ! -f /var/run/daemons/nfslock ]; then
17 echo "ERROR: nfslock is not running"
18 stat_fail
19 exit 1
21 if [ ! -f /var/run/daemons/nfsd ]; then
22 echo "ERROR: nfsd is not running"
23 stat_fail
24 exit 1
26 [ -z "$SFSSD_PID" ] && /usr/sbin/sfssd
27 if [ $? -gt 0 ]; then
28 stat_fail
29 exit 1
30 else
31 echo `pidof -o %PPID sfssd` > /var/run/sfssd.pid
33 add_daemon $DAEMON_NAME
34 stat_done
37 stop)
38 stat_busy "Stopping $DAEMON_NAME"
39 [ ! -z "$SFSSD_PID" ] && kill $SFSSD_PID &> /dev/null
40 if [ $? -gt 0 ]; then
41 stat_fail
42 exit 1
43 else
44 kill -9 $SFSSD_PID &> /dev/null
45 rm /var/run/sfssd.pid &> /dev/null
47 rm_daemon $DAEMON_NAME
48 stat_done
51 restart)
52 $0 stop
53 sleep 2
54 $0 start
58 echo "usage: $0 {start|stop|restart}"
59 esac
60 exit 0