[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force XFree86 SVN commit: r2143 - trunk/debian



Author: branden
Date: 2005-01-21 13:08:32 -0500 (Fri, 21 Jan 2005)
New Revision: 2143

Modified:
   trunk/debian/CHANGESETS
   trunk/debian/changelog
   trunk/debian/xdm.init
Log:
Make more improvements to xdm's init script:
+ Stop forcing the script to exit if given the "stop" argument and the
  daemon is assumed to not be running due to no process ID file being found
  (this would cause "restart" to fail to start the daemon in this case).
+ Remove the "daemon-not-stopped" flag file if asked to stop the daemon and
  it either appears to not be running, or was successfully stopped.
+ Update and clarify comments.


Modified: trunk/debian/CHANGESETS
===================================================================
--- trunk/debian/CHANGESETS	2005-01-20 07:10:20 UTC (rev 2142)
+++ trunk/debian/CHANGESETS	2005-01-21 18:08:32 UTC (rev 2143)
@@ -110,8 +110,14 @@
 + Use the term "process ID" instead of "process-id".
 Update the stillrunning() function in xdm's init script to remove a
 known-stale /var/run/xdm.pid file if it is present.  Stop removing the
-daemon-not-stopped file, as code removing it is run elsewhere.
-    2121
+daemon-not-stopped file, as code removing it is run elsewhere.  Stop
+forcing the script to exit if given the "stop" argument and the daemon is
+assumed to not be running due to no process ID file being found (this
+would cause "restart" to fail to start the daemon in this case).  Remove
+the "daemon-not-stopped" flag file if asked to stop the daemon and it
+either appears to not be running, or was successfully stopped.  Update and
+clarify comments in xdm's init script.
+    2121, 2143
 
 Fix typo in German debconf template translations.  Thanks, Georg Neis!
 (Closes: #289508)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2005-01-20 07:10:20 UTC (rev 2142)
+++ trunk/debian/changelog	2005-01-21 18:08:32 UTC (rev 2143)
@@ -88,7 +88,13 @@
 
   * Update the stillrunning() function in xdm's init script to remove a
     known-stale /var/run/xdm.pid file if it is present.  Stop removing the
-    daemon-not-stopped file, as code removing it is run elsewhere.
+    daemon-not-stopped file, as code removing it is run elsewhere.  Stop
+    forcing the script to exit if given the "stop" argument and the daemon is
+    assumed to not be running due to no process ID file being found (this
+    would cause "restart" to fail to start the daemon in this case).  Remove
+    the "daemon-not-stopped" flag file if asked to stop the daemon and it
+    either appears to not be running, or was successfully stopped.  Update and
+    clarify comments in xdm's init script.
 
   * Fix typo in German debconf template translations.  Thanks, Georg Neis!
     (Closes: #289508)

Modified: trunk/debian/xdm.init
===================================================================
--- trunk/debian/xdm.init	2005-01-20 07:10:20 UTC (rev 2142)
+++ trunk/debian/xdm.init	2005-01-21 18:08:32 UTC (rev 2143)
@@ -46,12 +46,12 @@
   fi
 }
 
-# If we upgraded the daemon, we can't use the --exec argument to
-# start-stop-daemon since the inode will have changed.  The risk here is that
-# in a situation where the daemon died, its pidfile was not cleaned up, and
-# some other process is now running under that pid, start-stop-daemon will send
-# signals to an innocent process.  However, this seems like a corner case.
-# C'est la vie!
+# If we have upgraded the daemon since we last started it, we can't use the
+# --exec argument to start-stop-daemon, because the daemon's inode will have
+# changed.  The risk here is that in a situation where the daemon died, its
+# pidfile was not cleaned up, we've upgraded it, *and* some other process is now
+# running under that pid, start-stop-daemon will send signals to an innocent
+# process.  However, this seems like a corner case.  C'est la vie!
 if [ -e $UPGRADEFILE ]; then
   SSD_START_ARGS="--pidfile $PIDFILE --startas $DAEMON"
   SSD_STOP_ARGS="--pidfile $PIDFILE --name ${DAEMON#**/}"
@@ -101,8 +101,10 @@
   stop)
     echo -n "Stopping X display manager: xdm"
     if ! [ -f $PIDFILE ]; then
-      echo " not running ($PIDFILE not found)."
-      exit 0
+      echo " not running ($PIDFILE not found)"
+      # The daemon is not running; do not tell the maintainer scripts that it
+      # has not stopped.
+      rm -f $UPGRADEFILE
     else
       DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]')
       KILLCOUNT=1
@@ -126,6 +128,8 @@
       if stillrunning; then
         echo -n " not responding to TERM signal (pid $DAEMONPID)"
       else
+        # The daemon is not running; do not tell the maintainer scripts that it
+        # has not stopped.
         rm -f $UPGRADEFILE
       fi
     fi



Reply to: