From 1ae9fb391fdb220b801dc93d500caa6b452f65ef Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Wed, 2 Jul 2008 23:35:53 +0000 Subject: [PATCH] - Changed the default directories for sm-notify (bz 435480) - Added 'condstop' to init scripts so service are not started when nfs-utils is removed. --- nfs-utils-1.1.2-smnotifypath.patch | 57 ++++++++++++++++++++++++++++++ nfs-utils.spec | 25 ++++++++----- nfs.init | 10 +++++- nfslock.init | 9 ++++- rpcgssd.init | 8 ++++- rpcidmapd.init | 8 ++++- rpcsvcgssd.init | 8 ++++- 7 files changed, 112 insertions(+), 13 deletions(-) create mode 100644 nfs-utils-1.1.2-smnotifypath.patch diff --git a/nfs-utils-1.1.2-smnotifypath.patch b/nfs-utils-1.1.2-smnotifypath.patch new file mode 100644 index 0000000..2a7f027 --- /dev/null +++ b/nfs-utils-1.1.2-smnotifypath.patch @@ -0,0 +1,57 @@ +diff -up nfs-utils-1.1.2/utils/statd/sm-notify.c.orig nfs-utils-1.1.2/utils/statd/sm-notify.c +--- nfs-utils-1.1.2/utils/statd/sm-notify.c.orig 2008-03-14 11:46:29.000000000 -0400 ++++ nfs-utils-1.1.2/utils/statd/sm-notify.c 2008-07-02 18:34:24.000000000 -0400 +@@ -24,11 +24,12 @@ + #include + #include + ++#define STATD_PATH_XTN "statd/" + #ifndef BASEDIR + # ifdef NFS_STATEDIR +-# define BASEDIR NFS_STATEDIR ++# define BASEDIR NFS_STATEDIR "/" STATD_PATH_XTN + # else +-# define BASEDIR "/var/lib/nfs" ++# define BASEDIR "/var/lib/nfs/" STATD_PATH_XTN + # endif + #endif + +diff -up nfs-utils-1.1.2/utils/statd/sm-notify.man.orig nfs-utils-1.1.2/utils/statd/sm-notify.man +--- nfs-utils-1.1.2/utils/statd/sm-notify.man.orig 2008-03-14 11:46:29.000000000 -0400 ++++ nfs-utils-1.1.2/utils/statd/sm-notify.man 2008-07-02 18:34:13.000000000 -0400 +@@ -33,7 +33,7 @@ but this is configurable. + For each NFS client or server machine to be monitored, + .B rpc.statd + creates a file in +-.BR /var/lib/nfs/sm ", " ++.BR /var/lib/nfs/statd/sm ", " + and removes the file if monitoring is no longer required. + .PP + When the machine is rebooted, +@@ -47,7 +47,7 @@ Each machine has an + which is basically an integer counter that is incremented + each time the machine reboots. This counter is stored + in +-.BR /var/lib/nfs/state , ++.BR /var/lib/nfs/statd/state , + and updated by + .BR sm-notify . + .SS Security +@@ -149,13 +149,13 @@ By default, + .B sm-notify + forks and puts itself in the background after obtaining the + list of hosts from +-.BR /var/lib/nfs/sm . ++.BR /var/lib/nfs/statd/sm . + .SH FILES +-.BR /var/lib/nfs/state ++.BR /var/lib/nfs/statd/state + .br +-.BR /var/lib/nfs/sm/* ++.BR /var/lib/nfs/statd/sm/* + .br +-.BR /var/lib/nfs/sm.bak/* ++.BR /var/lib/nfs/statd/sm.bak/* + .br + .BR /var/run/sm-notify.pid + .SH SEE ALSO diff --git a/nfs-utils.spec b/nfs-utils.spec index 970d96f..8d67363 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser Name: nfs-utils URL: http://sourceforge.net/projects/nfs Version: 1.1.2 -Release: 11%{?dist} +Release: 12%{?dist} Epoch: 1 # group all 32bit related archs @@ -31,6 +31,7 @@ Patch05: nfs-utils-1.1.0-exportfs-open.patch Patch06: nfs-utils-1.1.0-exportfs-man-update.patch Patch07: nfs-utils-1.1.2-multi-auth-flavours.patch Patch08: nfs-utils-1.1.2-mount-eacces.patch +Patch09: nfs-utils-1.1.2-smnotifypath.patch Patch101: nfs-utils-1.1.2-tcpwrapper-fix.patch Patch102: nfs-utils-1.1.2-mount-retry.patch @@ -80,14 +81,14 @@ License: GPL Buildroot: %{_tmppath}/%{name}-%{version}-root Requires: rpcbind, sed, gawk, sh-utils, fileutils, textutils, grep Requires: modutils >= 2.4.26-9 -BuildRequires: libgssglue-devel libevent-devel >= 1.4.4 +BuildRequires: libgssglue-devel libevent-devel BuildRequires: nfs-utils-lib-devel >= 1.1.0-3 BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2 BuildRequires: automake, libtool, glibc-headers BuildRequires: e2fsprogs-devel, krb5-devel, tcp_wrappers-devel Requires(pre): shadow-utils >= 4.0.3-25 Requires(pre): /sbin/chkconfig /sbin/nologin -Requires: nfs-utils-lib >= 1.1.0-3 libgssglue libevent >= 1.4.4 +Requires: nfs-utils-lib >= 1.1.0-3 libgssglue libevent %description The nfs-utils package provides a daemon for the kernel NFS server and @@ -112,6 +113,7 @@ This package also contains the mount.nfs and umount.nfs program. %patch06 -p1 %patch07 -p1 %patch08 -p1 +%patch09 -p1 %patch101 -p1 %patch102 -p1 @@ -182,6 +184,7 @@ touch $RPM_BUILD_ROOT/var/lib/nfs/rmtab mv $RPM_BUILD_ROOT/usr/sbin/rpc.statd $RPM_BUILD_ROOT/sbin mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/statd/sm +mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/statd/sm.bak mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/v4recovery %clean @@ -222,10 +225,10 @@ chown -R rpcuser:rpcuser /var/lib/nfs/statd %preun if [ "$1" = "0" ]; then - /etc/rc.d/init.d/nfs condrestart - /etc/rc.d/init.d/rpcgssd condrestart - /etc/rc.d/init.d/rpcidmapd condrestart - /etc/rc.d/init.d/nfslock condrestart + /etc/rc.d/init.d/nfs condstop > /dev/null + /etc/rc.d/init.d/rpcgssd condstop > /dev/null + /etc/rc.d/init.d/rpcidmapd condstop > /dev/null + /etc/rc.d/init.d/nfslock condstop > /dev/null /sbin/chkconfig --del rpcidmapd /sbin/chkconfig --del rpcgssd /sbin/chkconfig --del rpcsvcgssd @@ -267,10 +270,11 @@ fi %dir /var/lib/nfs %dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd %dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd/sm +%dir %attr(700,rpcuser,rpcuser) /var/lib/nfs/statd/sm.bak +%config(noreplace) %attr(644,rpcuser,rpcuser) /var/lib/nfs/state %config(noreplace) /var/lib/nfs/xtab %config(noreplace) /var/lib/nfs/etab %config(noreplace) /var/lib/nfs/rmtab -%config(noreplace) /var/lib/nfs/state %doc linux-nfs/* /sbin/rpc.statd /usr/sbin/exportfs @@ -295,6 +299,11 @@ fi %attr(4755,root,root) /sbin/umount.nfs4 %changelog +* Wed Jul 2 2008 Steve Dickson 1.1.2-12 +- Changed the default directories for sm-notify (bz 435480) +- Added 'condstop' to init scripts so service are not + started when nfs-utils is removed. + * Mon Jun 30 2008 Dennis Gilmore 1.1.2-11 - add sparc arch handling diff --git a/nfs.init b/nfs.init index 7948d63..b4f2747 100755 --- a/nfs.init +++ b/nfs.init @@ -171,10 +171,18 @@ case "$1" in [ -f /var/lock/subsys/nfs ] && { $0 stop $0 start + RETVAL=$? + } + ;; + condstop) + [ -x /usr/sbin/rpc.svcgssd ] && /sbin/service rpcsvcgssd condstop + [ -f /var/lock/subsys/nfs ] && { + $0 stop + RETVAL=$? } ;; *) - echo $"Usage: nfs {start|stop|status|restart|reload|condrestart}" + echo $"Usage: nfs {start|stop|status|restart|reload|condrestart|condstop}" RETVAL=3 ;; esac diff --git a/nfslock.init b/nfslock.init index ae1b667..5639b12 100755 --- a/nfslock.init +++ b/nfslock.init @@ -113,10 +113,17 @@ case "$1" in [ -f /var/lock/subsys/nfslock ] && { stop start + RETVAL=$? + } + ;; + condstop) + [ -f /var/lock/subsys/nfslock ] && { + stop + RETVAL=$? } ;; *) - echo $"Usage: $0 {start|stop|status|restart|probe|condrestart}" + echo $"Usage: $0 {start|stop|status|restart|probe|condrestart|condstop}" RETVAL=3 ;; esac diff --git a/rpcgssd.init b/rpcgssd.init index b281a42..4c46c32 100755 --- a/rpcgssd.init +++ b/rpcgssd.init @@ -105,8 +105,14 @@ case "$1" in RETVAL=$? fi ;; + condstop) + if [ -f $LOCKFILE ]; then + $0 stop + RETVAL=$? + fi + ;; *) - echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}" + echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status|condstop}" RETVAL=3 ;; esac diff --git a/rpcidmapd.init b/rpcidmapd.init index 49dc66d..2896379 100755 --- a/rpcidmapd.init +++ b/rpcidmapd.init @@ -90,8 +90,14 @@ case "$1" in RETVAL=$? fi ;; + condstop) + if [ -f $LOCKFILE ]; then + $0 stop + RETVAL=$? + fi + ;; *) - echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}" + echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status|condstop}" RETVAL=3 ;; esac diff --git a/rpcsvcgssd.init b/rpcsvcgssd.init index 249c42b..91e6cb2 100755 --- a/rpcsvcgssd.init +++ b/rpcsvcgssd.init @@ -105,8 +105,14 @@ case "$1" in RETVAL=$? fi ;; + condstop) + if [ -f $LOCKFILE ]; then + $0 stop + RETVAL=$? + fi + ;; *) - echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status}" + echo $"Usage: $0 {start|stop|restart|condstart|condrestart|status|condstop}" RETVAL=3 ;; esac