wok-stable view unfs3/stuff/etc/init.d/unfsd @ rev 2482
h*: update depends
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Mar 15 20:53:26 2009 +0000 (2009-03-15) |
parents | |
children | 1b6281d68d9f |
line source
1 #!/bin/sh
2 # /etc/init.d/unfsd : Start, stop and restart NFSv3 Server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start NFSv3 Server at boot time, just put dropbear in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=unfsd
12 DESC="NFSv3 Server"
13 DAEMON=/usr/bin/unfsd
14 OPTIONS=
15 PIDFILE=/var/run/$NAME.pid
18 test -f $DAEMON || exit 0
20 case "$1" in
21 start)
22 if [ -f $PIDFILE ] ; then
23 echo "$NAME already running."
24 exit 1
25 fi
27 echo -n "Starting $DESC: $NAME... "
28 $DAEMON $OPTIONS
29 status
31 # registering PID
32 if [ $? -eq 0 ]; then
33 pidof -s $NAME > $PIDFILE
34 fi
35 ;;
36 stop)
37 if [ ! -f $PIDFILE ] ; then
38 echo "$NAME is not running."
39 exit 1
40 fi
41 echo -n "Stopping $DESC: $NAME... "
42 kill `cat $PIDFILE`
43 rm -f $PIDFILE
44 status
45 ;;
46 restart)
47 $0 stop
48 $0 start
49 ;;
50 *)
51 echo "Usage: $DAEMON {start|stop|reload|restart}"
52 exit 1
53 ;;
54 esac
56 exit 0