wok-current annotate unfs3/stuff/etc/init.d/unfsd @ rev 25725

Patch openssh CVE-2024-6387
author Stanislas Leduc <shann@slitaz.org>
date Mon Jul 01 15:09:44 2024 +0000 (3 months ago)
parents 1b6281d68d9f
children
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
al@19159 12 DESC="$(_ '%s server' NFSv3)"
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
al@19159 21 start)
al@19159 22 if active_pidfile $PIDFILE unfsd ; then
al@19159 23 _ '%s is already running.' $NAME
al@19159 24 exit 1
al@19159 25 fi
erjo@171 26
al@19159 27 action 'Starting %s: %s...' "$DESC" $NAME
al@19159 28 $DAEMON $OPTIONS
al@19159 29 status
al@19159 30
al@19159 31 # registering PID
al@19159 32 if [ $? -eq 0 ]; then
al@19159 33 pidof -s $NAME > $PIDFILE
al@19159 34 fi
al@19159 35 ;;
al@19159 36 stop)
al@19159 37 if ! active_pidfile $PIDFILE unfsd ; then
al@19159 38 _ '%s is not running.' $NAME
al@19159 39 exit 1
al@19159 40 fi
al@19159 41 action 'Stopping %s: %s...' "$DESC" $NAME
al@19159 42 kill $(cat $PIDFILE)
al@19159 43 rm -f $PIDFILE
al@19159 44 status
al@19159 45 ;;
al@19159 46 restart)
al@19159 47 $0 stop
al@19159 48 $0 start
al@19159 49 ;;
al@19159 50 *)
al@19159 51 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
al@19159 52 newline
al@19159 53 exit 1
al@19159 54 ;;
erjo@171 55 esac
erjo@171 56
erjo@171 57 exit 0