X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=debian%2Fnfs-common.init;h=6de833621209841e766b00cce2caa29ac2978334;hp=76ceaca2819ff141590043761fae63c09d21b17a;hb=refs%2Ftags%2Fdebian%2F1%251.0.8-6;hpb=bc700ac52d47969d873499e3050d028335eda14d diff --git a/debian/nfs-common.init b/debian/nfs-common.init old mode 100755 new mode 100644 index 76ceaca..6de8336 --- a/debian/nfs-common.init +++ b/debian/nfs-common.init @@ -113,18 +113,26 @@ do_mount() { return 0 } +do_umount() { + if mountpoint -q "$1" + then + umount "$1" + fi + return 0 +} + # See how we were called. case "$1" in start) cd / # daemons should have root dir as cwd printf "Starting $DESC:" printf " statd" - start-stop-daemon --start --quiet \ + start-stop-daemon --start --oknodo --quiet \ --exec $PREFIX/sbin/rpc.statd -- $STATDOPTS if [ "$NEED_LOCKD" = yes ] then printf " lockd" - start-stop-daemon --start --quiet \ + start-stop-daemon --start --oknodo --quiet \ --exec $PREFIX/sbin/rpc.lockd || true fi if [ "$NEED_IDMAPD" = yes ] || [ "$NEED_GSSD" = yes ] @@ -136,7 +144,7 @@ case "$1" in if [ "$NEED_IDMAPD" = yes ] then printf " idmapd" - start-stop-daemon --start --quiet \ + start-stop-daemon --start --oknodo --quiet \ --make-pidfile --pidfile $IDMAPD_PIDFILE \ --exec /usr/sbin/rpc.idmapd fi @@ -144,7 +152,7 @@ case "$1" in then do_modprobe rpcsec_gss_krb5 printf " gssd" - start-stop-daemon --start --quiet \ + start-stop-daemon --start --oknodo --quiet \ --make-pidfile --pidfile $GSSD_PIDFILE \ --exec /usr/sbin/rpc.gssd -- $RPCGSSDOPTS fi @@ -180,9 +188,48 @@ case "$1" in printf " statd" start-stop-daemon --stop --oknodo --quiet \ --name rpc.statd + do_umount $PIPEFS_MOUNTPOINT 2>/dev/null || true echo "." ;; + status) + if ! pidof rpc.statd >/dev/null + then + echo "rpc.statd not running" + exit 3 + fi + + if [ "$NEED_GSSD" = yes ] + then + if [ ! -f "$GSSD_PIDFILE" ] || [ "$( pidof rpc.gssd )" != "$( cat $GSSD_PIDFILE )"] + then + echo "rpc.statd running, but rpc.gssd halted" + exit 3 + fi + fi + + if [ "$NEED_LOCKD" = yes ] + then + if ! pidof rpc.lockd >/dev/null + then + echo "rpc.statd running, but rpc.lockd halted" + exit 3 + fi + fi + + if [ "$NEED_IDMAPD" = yes ] + then + if [ ! -f "$IDMAPD_PIDFILE" ] || [ "$( pidof rpc.idmapd )" != "$( cat $IDMAPD_PIDFILE )"] + then + echo "rpc.statd running, but rpc.idmapd halted" + exit 3 + fi + fi + + echo "rpc.statd running" + exit 0 + ;; + restart | force-reload) $0 stop sleep 1