wok view unfs3/stuff/etc/init.d/unfsd @ rev 12697

slitaz-tools: temp patch to tazinst removed
author Dominique Corbex <domcox@slitaz.org>
date Thu May 03 07:51:54 2012 +0200 (2012-05-03)
parents 3c1e91a7263a
children 7f188676b59c
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 active_pidfile $PIDFILE unfsd ; 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 ! active_pidfile $PIDFILE unfsd ; 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