rpms/autofs/F-12 autofs-5.0.5-fix-pidof-init-script-usage.patch, NONE, 1.1 autofs.spec, 1.291, 1.292

Ian Kent iankent at fedoraproject.org
Wed Nov 25 01:28:48 UTC 2009


Author: iankent

Update of /cvs/pkgs/rpms/autofs/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28334

Modified Files:
	autofs.spec 
Added Files:
	autofs-5.0.5-fix-pidof-init-script-usage.patch 
Log Message:
* Wed Nov 25 2009 Ian Kent <ikent at redhat.com> - 1:5.0.5-11
- fix pidof init script usage.


autofs-5.0.5-fix-pidof-init-script-usage.patch:
 CHANGELOG             |    1 +
 redhat/autofs.init.in |    8 ++++----
 samples/rc.autofs.in  |    8 ++++----
 3 files changed, 9 insertions(+), 8 deletions(-)

--- NEW FILE autofs-5.0.5-fix-pidof-init-script-usage.patch ---
autofs-5.0.5 - fix pidof init script usage

From: Ian Kent <raven at themaw.net>

For some reason, following an update, pidof doesn't return the pid
of a running automount daemon when the path is used rather than just
the name, probably to do with the inode of the daemon program changing.

So we change the init script to use just the program name rather than
the path.
---

 CHANGELOG             |    1 +
 redhat/autofs.init.in |    8 ++++----
 samples/rc.autofs.in  |    8 ++++----
 3 files changed, 9 insertions(+), 8 deletions(-)


diff --git a/CHANGELOG b/CHANGELOG
index dd093e2..cc2efab 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -12,6 +12,7 @@
 - don't use master_lex_destroy() to clear parse buffer.
 - make documentation for set-log-priority clearer.
 - fix timeout in connect_nb().
+- fix pidof init script usage.
 
 03/09/2009 autofs-5.0.5
 -----------------------
diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in
index 806302b..363e824 100644
--- a/redhat/autofs.init.in
+++ b/redhat/autofs.init.in
@@ -101,14 +101,14 @@ function start() {
 function stop() {
 	echo -n $"Stopping $prog: "
 	count=0
-	while [ -n "`pidof $DAEMON`" -a $count -lt 15 ] ; do
+	while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
 		killproc $prog -TERM >& /dev/null
 		RETVAL=$?
-		[ $RETVAL = 0 -a -z "`pidof $DAEMON`" ] || sleep 3
+		[ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 3
 		count=`expr $count + 1`
 	done
 	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/autofs
-	if [ -n "`pidof $DAEMON`" ] ; then
+	if [ -n "`pidof $prog`" ] ; then
 		failure "$prog shutdown"
 	else
 		success "$prog shutdown"
@@ -128,7 +128,7 @@ function reload() {
 		RETVAL=1
 		return $RETVAL
 	fi
-	pid=`pidof $DAEMON`
+	pid=`pidof $prog`
 	if [ -z $pid ]; then
 		echo $"$prog not running"
 		RETVAL=1
diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in
index b193a4e..ae2e907 100644
--- a/samples/rc.autofs.in
+++ b/samples/rc.autofs.in
@@ -88,13 +88,13 @@ function start() {
 function stop() {
 	echo -n $"Stopping $prog: "
 	count=0
-	while [ -n "`pidof $DAEMON`" -a $count -lt 15 ] ; do
+	while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
 		killall -TERM $prog >& /dev/null
 		RETVAL=$?
-		[ $RETVAL = 0 -a -z "`pidof $DAEMON`" ] || sleep 3
+		[ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 3
 		count=`expr $count + 1`
 	done
-	if [ -z "`pidof $DAEMON`" ] ; then
+	if [ -z "`pidof $prog`" ] ; then
 		echo "done."
 	else
 		echo "failed."
@@ -108,7 +108,7 @@ function restart() {
 }
 
 function reload() {
-	pid=`pidof $DAEMON`
+	pid=`pidof $prog`
 	if [ -z $pid ]; then
 		echo $"$prog not running"
 		RETVAL=1


Index: autofs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/autofs/F-12/autofs.spec,v
retrieving revision 1.291
retrieving revision 1.292
diff -u -p -r1.291 -r1.292
--- autofs.spec	23 Nov 2009 02:23:37 -0000	1.291
+++ autofs.spec	25 Nov 2009 01:28:48 -0000	1.292
@@ -4,7 +4,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems
 Name: autofs
 Version: 5.0.5
-Release: 9%{?dist}
+Release: 11%{?dist}
 Epoch: 1
 License: GPLv2+
 Group: System Environment/Daemons
@@ -22,6 +22,7 @@ Patch9: autofs-5.0.5-fix-ext4-fsck-at-mo
 Patch10: autofs-5.0.5-dont-use-master_lex_destroy-to-clear-parse-buffer.patch
 Patch11: autofs-5.0.5-make-documentation-for-set-log-priority-clearer.patch
 Patch12: autofs-5.0.5-fix-timeout-in-connect_nb.patch
+Patch13: autofs-5.0.5-fix-pidof-init-script-usage.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel module-init-tools util-linux nfs-utils e2fsprogs libtirpc-devel
 Requires: kernel >= 2.6.17
@@ -75,6 +76,7 @@ echo %{version}-%{release} > .version
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
 
 %build
 #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -127,6 +129,9 @@ fi
 %{_libdir}/autofs/
 
 %changelog
+* Wed Nov 25 2009 Ian Kent <ikent at redhat.com> - 1:5.0.5-11
+- fix pidof init script usage.
+
 * Mon Nov 23 2009 Ian Kent <ikent at redhat.com> - 1:5.0.5-9
 - fix timeout in connect_nb().
 




More information about the fedora-extras-commits mailing list