diff options
Diffstat (limited to 'abs/core/runit-scripts/runitscripts/services/nfs-common/finish')
-rwxr-xr-x | abs/core/runit-scripts/runitscripts/services/nfs-common/finish | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/abs/core/runit-scripts/runitscripts/services/nfs-common/finish b/abs/core/runit-scripts/runitscripts/services/nfs-common/finish new file mode 100755 index 0000000..531192d --- /dev/null +++ b/abs/core/runit-scripts/runitscripts/services/nfs-common/finish @@ -0,0 +1,51 @@ +#!/bin/bash +exec 2>&1 +export TERM=linux +daemon_name=nfs-common +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + + +# rpc.statd daemon & binary location +STATD_DAEMON_NAME=rpc.statd +STATD="/usr/sbin/rpc.statd" + +# rpc.idmapd daemon & binary location +IDMAPD_DAEMON_NAME=rpc.idmapd +IDMAPD="/usr/sbin/rpc.idmapd" + +# rpc.gssd daemon & binary location +GSSD_DAEMON_NAME=rpc.gssd +GSSD="/usr/sbin/rpc.gssd" + +do_umount() { + if mountpoint -q "$1" ; then + umount "$1" + fi + return 0 +} + +get_pid() { + pidof -o %PPID "$1" +} + + +stat_runit "Stopping $GSSD_DAEMON_NAME daemon" +PID=$(get_pid $GSSD) +[ ! -z "$PID" ] && kill $PID &> /dev/null +rm -f /var/run/$GSSD_DAEMON_NAME.pid &> /dev/null + +stat_runit "Stopping $IDMAPD_DAEMON_NAME daemon" +PID=$(get_pid $IDMAPD) +# KILL +[ ! -z "$PID" ] && kill $PID &> /dev/null + rm -f /var/run/$IDMAPD_DAEMON_NAME.pid &> /dev/null +do_umount "$PIPEFS_MOUNTPOINT" 2>/dev/null || true + +stat_runit "Stopping $STATD_DAEMON_NAME daemon" +PID=$(get_pid $STATD) +# KILL +[ ! -z "$PID" ] && kill $PID &> /dev/null +rm -f /var/run/$STATD_DAEMON_NAME.pid &> /dev/null + |