From db454c10e20488033aa5c03722c4bd8167206cf7 Mon Sep 17 00:00:00 2001 From: Luk Claes Date: Sun, 13 Mar 2011 18:52:57 +0100 Subject: [PATCH] nfs-common.init, nfs-kernel-server.init: Add warning when portmap is not running (Closes: #612002) When portmap (or rpcbind) are not running, don't try to start statd, nfsd or mountd, but warn instead that portmap is not running. This means installing nfs-common or nfs-kernel-server would succeed even if the daemons are not started. --- debian/changelog | 7 ++++++- debian/nfs-common.init | 10 ++++++++++ debian/nfs-kernel-server.init | 10 ++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 808c96f..e32b078 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,16 @@ nfs-utils (1:1.2.2-5) UNRELEASED; urgency=low + [ Ben Hutchings ] * mount.nfs.man, nfs.man: Update distinction between fstypes (Closes: #575503) * nfs-kernel-server.init: Require any installed name server ($named) to start before nfs-kernel-server (Closes: #598493) - -- Ben Hutchings Sat, 02 Oct 2010 20:05:53 +0100 + [ Luk Claes ] + * nfs-common.init, nfs-kernel-server.init: Add warning when portmap is + not running (Closes: #612002) + + -- Luk Claes Sun, 13 Mar 2011 18:49:29 +0100 nfs-utils (1:1.2.2-4) unstable; urgency=low diff --git a/debian/nfs-common.init b/debian/nfs-common.init index 9f5ebf5..32e89c8 100644 --- a/debian/nfs-common.init +++ b/debian/nfs-common.init @@ -136,6 +136,16 @@ case "$1" in if [ "$NEED_STATD" = yes ]; then log_progress_msg "statd" + + # See if portmap or rpcbind are running + lsof -i :111 >/dev/null + 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 \ --exec $PREFIX/sbin/rpc.statd -- $STATDOPTS RET=$? diff --git a/debian/nfs-kernel-server.init b/debian/nfs-kernel-server.init index 155effd..b7a9633 100644 --- a/debian/nfs-kernel-server.init +++ b/debian/nfs-kernel-server.init @@ -82,6 +82,16 @@ case "$1" in log_daemon_msg "Starting $DESC" log_progress_msg "nfsd" + + # See if portmap or rpcbind are running + lsof -i :111 >/dev/null + 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 \ --nicelevel $RPCNFSDPRIORITY \ --exec $PREFIX/sbin/rpc.nfsd -- $RPCNFSDCOUNT -- 2.39.2