wok annotate unfs3/stuff/etc/init.d/unfsd @ rev 12254

Up: slitaz-configs (4.9.1) - Last minute bug fix
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 10 13:54:27 2012 +0200 (2012-04-10)
parents 3c1e91a7263a
children 7f188676b59c
rev   line source
erjo@171 1 #!/bin/sh
erjo@171 2 # /etc/init.d/unfsd : Start, stop and restart NFSv3 Server on SliTaz, at
erjo@171 3 # boot time or with the command line.
erjo@171 4 #
erjo@171 5 # To start NFSv3 Server at boot time, just put dropbear in the $RUN_DAEMONS
erjo@171 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
erjo@171 7 #
erjo@171 8 . /etc/init.d/rc.functions
erjo@171 9 . /etc/daemons.conf
erjo@171 10
erjo@171 11 NAME=unfsd
erjo@171 12 DESC="NFSv3 Server"
erjo@171 13 DAEMON=/usr/bin/unfsd
erjo@171 14 OPTIONS=
erjo@171 15 PIDFILE=/var/run/$NAME.pid
erjo@171 16
erjo@171 17
erjo@171 18 test -f $DAEMON || exit 0
erjo@171 19
erjo@171 20 case "$1" in
erjo@171 21 start)
pascal@6170 22 if active_pidfile $PIDFILE unfsd ; then
erjo@171 23 echo "$NAME already running."
erjo@171 24 exit 1
erjo@171 25 fi
erjo@171 26
erjo@171 27 echo -n "Starting $DESC: $NAME... "
erjo@171 28 $DAEMON $OPTIONS
erjo@171 29 status
erjo@171 30
erjo@171 31 # registering PID
erjo@171 32 if [ $? -eq 0 ]; then
erjo@171 33 pidof -s $NAME > $PIDFILE
erjo@171 34 fi
erjo@171 35 ;;
erjo@171 36 stop)
pascal@6170 37 if ! active_pidfile $PIDFILE unfsd ; then
erjo@171 38 echo "$NAME is not running."
erjo@171 39 exit 1
erjo@171 40 fi
erjo@171 41 echo -n "Stopping $DESC: $NAME... "
erjo@171 42 kill `cat $PIDFILE`
erjo@171 43 rm -f $PIDFILE
erjo@171 44 status
erjo@171 45 ;;
erjo@171 46 restart)
erjo@171 47 $0 stop
erjo@171 48 $0 start
erjo@171 49 ;;
erjo@171 50 *)
erjo@171 51 echo "Usage: $DAEMON {start|stop|reload|restart}"
erjo@171 52 exit 1
erjo@171 53 ;;
erjo@171 54 esac
erjo@171 55
erjo@171 56 exit 0
erjo@171 57