Author: branden Date: 2005-06-09 15:40:25 -0500 (Thu, 09 Jun 2005) New Revision: 165
Modified: trunk/debian/xdm.init trunk/debian/xfs.init Log: Resync xdm and xfs's init scripts with Debian xfree86 SVN trunk. Modified: trunk/debian/xdm.init =================================================================== --- trunk/debian/xdm.init 2005-06-09 20:25:47 UTC (rev 164) +++ trunk/debian/xdm.init 2005-06-09 20:40:25 UTC (rev 165) @@ -38,8 +38,10 @@ 2>&1; then true else - # if the daemon does not remove its own pidfile, we will - rm -f $PIDFILE $UPGRADEFILE + if [ -e $PIDFILE ]; then + echo -n " (removing stale $PIDFILE)" + rm $PIDFILE + fi false fi } @@ -103,7 +105,6 @@ # The daemon is not running; do not tell the maintainer scripts that it # has not stopped. rm -f $UPGRADEFILE - exit 0 else DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]') KILLCOUNT=1 Modified: trunk/debian/xfs.init =================================================================== --- trunk/debian/xfs.init 2005-06-09 20:25:47 UTC (rev 164) +++ trunk/debian/xfs.init 2005-06-09 20:40:25 UTC (rev 165) @@ -1,5 +1,7 @@ #!/bin/sh +# $Id: xfs.init 2151 2005-01-24 16:54:48Z branden $ + # Copyright 1998-2004 Branden Robinson <[EMAIL PROTECTED]>. # # This is free software; you may redistribute it and/or modify @@ -53,18 +55,20 @@ 2>&1; then true else - # if the daemon does not remove its own pidfile, we will - rm -f $PIDFILE $UPGRADEFILE + if [ -e $PIDFILE ]; then + echo -n " (removing stale $PIDFILE)" + rm $PIDFILE + fi false 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#**/}" @@ -108,8 +112,10 @@ stop) echo -n "Stopping X font server: xfs" 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 @@ -133,6 +139,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 @@ -147,4 +155,4 @@ exit 0 -# vim:set ai et sts=2 sw=2 tw=0: +# vim:set ai et sts=2 sw=2 tw=80: -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]