From e3ed016202e36ed5cb869511cc48b21019e47f5045362f8df86cfa0e0a90907b Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 26 Sep 2008 13:05:25 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/nfs-utils?expand=0&rev=33 --- nfs-utils.changes | 8 ++++++++ nfs-utils.spec | 7 ++++++- nfs.init | 21 +++++++++++++-------- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/nfs-utils.changes b/nfs-utils.changes index 2996370..6ca7e5e 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Sep 26 04:01:46 CEST 2008 - nfbrown@suse.de + +- Fix nfs.init to check for portmap or rpcbind properly. + Either or both can be installed, but as long as one is + running, neither 'start' or 'status' will complain. + bnc#428436 + ------------------------------------------------------------------- Mon Sep 22 04:20:30 CEST 2008 - nfbrown@suse.de diff --git a/nfs-utils.spec b/nfs-utils.spec index 9e3e37e..a5f7d1d 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -27,7 +27,7 @@ BuildRequires: libevent Url: http://nfs.sourceforge.net Summary: Support Utilities for Kernel nfsd Version: 1.1.3 -Release: 3 +Release: 4 Group: Productivity/Networking/NFS License: GPL v2 or later BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -281,6 +281,11 @@ rm -rf $RPM_BUILD_ROOT %doc nfs/*.html nfs/*.ps linux-nfs/* README.NFSv4 %changelog +* Fri Sep 26 2008 nfbrown@suse.de +- Fix nfs.init to check for portmap or rpcbind properly. + Either or both can be installed, but as long as one is + running, neither 'start' or 'status' will complain. + bnc#428436 * Mon Sep 22 2008 nfbrown@suse.de - Change nfs.init to do nothing if NFS is not mentioend in /etc/fstab, and sure it is always enabled. bnc#331667 diff --git a/nfs.init b/nfs.init index ceab87d..d8c153f 100644 --- a/nfs.init +++ b/nfs.init @@ -89,11 +89,16 @@ if test "$NFS4_SUPPORT" = yes ; then NEED_IDMAPD=yes fi -if test -x /sbin/portmap ; then - PORTMAP_BIN=/sbin/portmap -elif test -x /sbin/rpcbind ; then - PORTMAP_BIN=/sbin/rpcbind -elif test $nfs = yes ; then +check_portmap() { + # check if either portmap or rpcbind is running + if test -x /sbin/portmap && checkproc /sbin/portmap + then true + elif test -x /sbin/rpcbind && checkproc /sbin/rpcbind + then true + else false + fi +} +if ! test $nfs = no -o -x /sbin/portmap -o -x /sbin/rpcbind; then echo "portmap/rpcbind is missing" rc_failed 3 rc_status -v @@ -170,7 +175,7 @@ case "$1-$nfs" in start-yes|reload-yes) echo -n "Starting NFS client services:" - if ! checkproc $PORTMAP_BIN ; then + if ! check_portmap ; then echo "portmap/rpcbind is not running" rc_failed 3 rc_status -v @@ -291,8 +296,8 @@ case "$1-$nfs" in echo "idmapd not running" rc_failed 3 fi - if ! checkproc /sbin/portmap; then - echo "Warning: portmap not running - nfs may not work well" + if ! check_portmap; then + echo "Warning: portmap/rpcbind not running - nfs may not work well" fi rc_status -v ;;