Author: dj
Date: 2008-10-26 00:58:59 -0600 (Sun, 26 Oct 2008)
New Revision: 8701

Modified:
   trunk/BOOK/bootscripts/ChangeLog
   trunk/BOOK/bootscripts/lfs/init.d/functions
Log:
Added Dan Nicholson's patch for #2160, and cleaned up tab/spacing in changelog.

Modified: trunk/BOOK/bootscripts/ChangeLog
===================================================================
--- trunk/BOOK/bootscripts/ChangeLog    2008-10-26 05:35:28 UTC (rev 8700)
+++ trunk/BOOK/bootscripts/ChangeLog    2008-10-26 06:58:59 UTC (rev 8701)
@@ -1,7 +1,14 @@
+2008-10-26     Dan Nicholson   <[EMAIL PROTECTED]>
+       * lfs/init.d/functions: Remove stale pid files when encountered
+         in loadproc/killproc/reloadproc. When the bootscript specifies
+         a pid file to use with the "-p pidfile" argument, *proc
+         functions previously bailed out when the referenced file
+         contains an invalid pid.
+
 2008-10-23     DJ Lucas        <[EMAIL PROTECTED]>
        * lfs/init.d/console: Removed BROKEN_COMPOSE as kernel patch has
          been accepted upstream.
- 
+
 2008-05-21     Bryan Kadzban   <[EMAIL PROTECTED]>
        * lfs/init.d/udev: lfs/init.d/udev_retry: Use new udevadm program.
 
@@ -100,7 +107,7 @@
 n/a - June 2, 2006
        * Removed console config file and makefile targets.
        * Removed references to /dev/bug and bugreport in udevand 
-          udev_retry bootscripts. (DJ Lucas)
+         udev_retry bootscripts. (DJ Lucas)
 n/a - April 17, 2006
        * Updated udev script to use the new udevsettle program.
        * Added udev_retry script for systems that have /usr on a different
@@ -108,26 +115,26 @@
 
 n/a - April 15, 2006
        * Cleaned up contrib directory.  Removed: contrib/init.d, 
-          contrib/enhanced, contrib/livecd, contrib/hotplug, and raq2 
+         contrib/enhanced, contrib/livecd, contrib/hotplug, and raq2 
          patch. (DJ Lucas)
 
 n/a - April 14, 2006
-        * Merged changes from udev_update branch (DJ Lucas)
+       * Merged changes from udev_update branch (DJ Lucas)
        * Replaced a return with an exit and reversed comment changes in 
-          udev bootscript. (Dan Nicholson)
+         udev bootscript. (Dan Nicholson)
        * Replaced walk_sysfs function in udev bootscript with new udevtrigger
-          program and move wait_for_uevents function inline. (DJ Lucas)
+         program and move wait_for_uevents function inline. (DJ Lucas)
        * Removed extra evaluate_retval in udev bootscript. (Ken Moffat)
-       * Wait for uevents to be processed in the udev script.  See ticket #1720
-         for details. (Matthew Burgess)
+       * Wait for uevents to be processed in the udev script.  See ticket
+         #1720 for details. (Matthew Burgess)
 
 n/a - March 21, 2006
-        * Removed old references to boot_log function and arguments passed
-          to boot_mesg_flush in echo_* functions. (DJ Lucas)
+       * Removed old references to boot_log function and arguments passed
+         to boot_mesg_flush in echo_* functions. (DJ Lucas)
 
 n/a - March 10, 2006
        * Moved src argument to ipv4-static-route service script and 
-          removed from ipv4-static service script. (DJ Lucas)
+         removed from ipv4-static service script. (DJ Lucas)
 
 n/a - March 8. 2006
        * Correct sourced path in checkfs script. (Matthew Burgess)
@@ -287,7 +294,8 @@
          related to boot_mesg changes (DJ Lucas, Alexander Patrakov)
        * syslog-ng is now installed by default (Jeremy Utley)
        * hotplug is now installed by default (Jeremy Utley)
-       * udev now uses /sbin/hotplug as the default hotplug handler (Nathan 
Coulson)
+       * udev now uses /sbin/hotplug as the default hotplug handler
+         (Nathan Coulson)
        * udev now mounts a tmpfs instead of a ramfs onto /dev,
          as suggested by Greg K-H (Nathan Coulson)
        * Created contrib/lsb, and added a LSB compliant functions file
@@ -354,8 +362,8 @@
        * All scriptes have been converted to use boot_mesg
 
 n/a - September 21, 2004
-       * boot_mesg has been enhanced.  Subsequent calls will overwrite previous
-         text, and it will wrap text basedupon the variable ${WCOL}. 
+       * boot_mesg has been enhanced.  Subsequent calls will overwrite
+         previous text, and it will wrap text basedupon the variable ${WCOL}. 
          (James Robertson)
        * Fixed mtu optional service typo (Kevin P Fleming)
        * Added SOURCE variable to ipv4-static-route (Kevin P Fleming)
@@ -806,7 +814,7 @@
        * Fixed network shutdown script
        * Fixed Makefile rc.6 to reboot
        * Added -s flag to grep command in rc.d/init.d/network -
-          suppresses an error if no ifconfig.* files exist
+         suppresses an error if no ifconfig.* files exist
 
 n/a - January 30, 2004:
 
@@ -827,8 +835,8 @@
 n/a - January 30, 2004:
 
        * New maintainers for the lfs-bootscripts package are:
-       Jeremy Utley ([EMAIL PROTECTED])
-       Nathan Coulson ([EMAIL PROTECTED])
+         Jeremy Utley ([EMAIL PROTECTED])
+         Nathan Coulson ([EMAIL PROTECTED])
 
 1.11 - February 3rd, 2003:
 
@@ -838,7 +846,7 @@
 1.10 - September 12th, 2002:
 
        * Fixed up checkfs to work with non-ext2 filesystems too (such as
-       minix).
+         minix).
 
 1.9 - April 5th, 2002:
 
@@ -884,9 +892,9 @@
 1.6 - February 26th, 2002:
 
        * replaced -o %PPID with -o $PPID throughout the functions script. This
-       construct does what it's supposed to do (don't take PPID into account
-       because this would fail if a running daemon and the bootscript have
-       the same name).
+         construct does what it's supposed to do (don't take PPID into account
+         because this would fail if a running daemon and the bootscript have
+         the same name).
 
        * added 'restart' to the swap script
 
@@ -914,7 +922,7 @@
          variable is set
 
        * removed the emptying of /etc/mtab since it's a symlink to
-        /proc/mounts now
+         /proc/mounts now
 
        * added the mountproc script which mounts the proc system. This is done
          because we need proc mounted even before the mountfs script is ran

Modified: trunk/BOOK/bootscripts/lfs/init.d/functions
===================================================================
--- trunk/BOOK/bootscripts/lfs/init.d/functions 2008-10-26 05:35:28 UTC (rev 
8700)
+++ trunk/BOOK/bootscripts/lfs/init.d/functions 2008-10-26 06:58:59 UTC (rev 
8701)
@@ -291,6 +291,12 @@
                pidofproc -s -p "${pidfile}" "${1}"
        fi
 
+       # Warn about stale pid file
+       if [ "$?" = 1 ]; then
+               boot_mesg -n "Removing stale pid file: ${pidfile}. " ${WARNING}
+               rm -f "${pidfile}"
+       fi
+
        if [ -n "${pidlist}" ]; then
                for pid in ${pidlist}
                do
@@ -504,7 +510,7 @@
 #                     warning in stdout
 #          return 4 - Program or service status is unknown
 #
-# Dependencies: nice
+# Dependencies: nice, rm
 #
 # Todo: LSB says this should be called start_daemon
 #       LSB does not say that it should call evaluate_retval
@@ -567,8 +573,8 @@
                                return 0 # 4
                                ;;
                        1)
-                               log_warning_msg "Unable to continue: ${pidfile} 
exists"
-                               return 0 # 4
+                               boot_mesg "Removing stale pid file: ${pidfile}" 
${WARNING}
+                               rm -f "${pidfile}"
                                ;;
                        3)
                                ;;
@@ -598,7 +604,7 @@
 #                     warning in stdout
 #          return 4 - Unknown Status
 #
-# Dependencies: kill
+# Dependencies: kill, rm
 #
 # Todo: LSB does not say that it should call evaluate_retval
 #       It checks for PIDFILE, which is deprecated.
@@ -648,6 +654,12 @@
                pidofproc -s -p "${pidfile}" "${1}"
        fi
 
+       # Remove stale pidfile
+       if [ "$?" = 1 ]; then
+               boot_mesg "Removing stale pid file: ${pidfile}." ${WARNING}
+               rm -f "${pidfile}"
+       fi
+
     # If running, send the signal
     if [ -n "${pidlist}" ]; then
        for pid in ${pidlist}

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to