]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - debian/nfs-common.init
Replace lsof usage with redirection to /dev/tcp
[nfs-utils.git] / debian / nfs-common.init
index 9f5ebf5bbca87ae2e67cdd453b449e0aa9a771ce..92ea10d8b8eee1657616ceee39c1fde11892234c 100644 (file)
@@ -136,12 +136,27 @@ case "$1" in
 
        if [ "$NEED_STATD" = yes ]; then
            log_progress_msg "statd"
+           
+           # See if portmap or rpcbind are running
+           cat </dev/null >/dev/tcp/localhost/111
+           RET=$?
+           if [ $RET != 0 ]; then
+               echo
+               log_warning_msg "Not starting: portmap daemon is not running"
+               exit 0
+           fi
+
            start-stop-daemon --start --oknodo --quiet \
+               --pidfile /var/run/rpc.statd.pid \
                --exec $PREFIX/sbin/rpc.statd -- $STATDOPTS
            RET=$?
            if [ $RET != 0 ]; then
                log_end_msg $RET
                exit $RET
+           else
+               mkdir -p /lib/init/rw/sendsigs.omit.d
+               rm -f /lib/init/rw/sendsigs.omit.d/statd
+               ln -s /var/run/rpc.statd.pid /lib/init/rw/sendsigs.omit.d/statd
            fi
        fi