From 4cbe3cd2b457ecea2f85e9ca116a074ba308ac55 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Nov 25 2009 02:02:43 +0000 Subject: - fix pidof init script usage. --- diff --git a/autofs-5.0.5-fix-pidof-init-script-usage.patch b/autofs-5.0.5-fix-pidof-init-script-usage.patch new file mode 100644 index 0000000..c03e897 --- /dev/null +++ b/autofs-5.0.5-fix-pidof-init-script-usage.patch @@ -0,0 +1,74 @@ +autofs-5.0.5 - fix pidof init script usage + +From: Ian Kent + +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. +--- + + redhat/autofs.init.in | 8 ++++---- + samples/rc.autofs.in | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + + +--- autofs-5.0.3.orig/redhat/autofs.init.in ++++ autofs-5.0.3/redhat/autofs.init.in +@@ -81,14 +81,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" +@@ -108,7 +108,7 @@ function reload() { + RETVAL=1 + return $RETVAL + fi +- pid=`pidof $DAEMON` ++ pid=`pidof $prog` + if [ -z $pid ]; then + echo $"$prog not running" + RETVAL=1 +--- autofs-5.0.3.orig/samples/rc.autofs.in ++++ autofs-5.0.3/samples/rc.autofs.in +@@ -69,13 +69,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 [ -n "`pidof $DAEMON`" ] ; then ++ if [ -n "`pidof $prog`" ] ; then + echo "done." + else + echo "failed." +@@ -89,7 +89,7 @@ function restart() { + } + + function reload() { +- pid=`pidof $DAEMON` ++ pid=`pidof $prog` + if [ -z $pid ]; then + echo $"$prog not running" + RETVAL=1 diff --git a/autofs.spec b/autofs.spec index 66ea776..1e47151 100644 --- a/autofs.spec +++ b/autofs.spec @@ -4,7 +4,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.0.3 -Release: 44 +Release: 45 Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -77,6 +77,7 @@ Patch64: autofs-5.0.3-renew-sasl-creds-upon-reconnect-fail.patch Patch65: autofs-5.0.3-fix-memory-leak-reading-ldap-master.patch Patch66: autofs-5.0.4-add-lsb-init-script-parameter-block.patch Patch67: autofs-5.0.3-hsterror.patch +Patch68: 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 Requires: kernel >= 2.6.17 @@ -185,6 +186,7 @@ echo %{version}-%{release} > .version %patch65 -p1 %patch66 -p1 %patch67 -p1 +%patch68 -p1 %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} @@ -237,6 +239,9 @@ fi %{_libdir}/autofs/ %changelog +* Wed Nov 25 2009 Ian Kent - 1:5.0.3-45 +- fix pidof init script usage. + * Fri Nov 6 2009 Ian Kent - 5.0.4-44 - fix incorrect host name lookup error message (bz483756).