[Splashy-devel] Bug#451846: splashy: garbage in non-splashy init scripts
Luca Capello
luca at pca.it
Mon Nov 19 00:43:19 UTC 2007
Hi Luis!
On Mon, 19 Nov 2007 01:36:10 +0100, Luis Mondesi wrote:
> Can you attach a copy of your /etc/init.d/kdm script here?
^^^
Except for the fact that it's xdm and not kdm, attached.
Thx, bye,
Gismo / Luca
-------------- next part --------------
#!/bin/sh
# $Id: xdm.init 996 2006-01-02 19:27:34Z ender $
# Copyright 1998-2002, 2004, 2005 Branden Robinson <branden at debian.org>.
# Copyright 2006 Eugene Konev <ejka at imfi.kspu.ru>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
#
# This is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License with
# the Debian operating system, in /usr/share/common-licenses/GPL; if
# not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
### BEGIN INIT INFO
# Provides: xdm
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: xfs $named slapd
# Should-Stop: xfs $named slapd
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
### END INIT INFO
set -e
# To start xdm even if it is not the default display manager, change
# HEED_DEFAULT_DISPLAY_MANAGER to "false."
# Also overridable from command line like:
# HEED_DEFAULT_DISPLAY_MANAGER=false /etc/init.d/xdm start
[ -z "$HEED_DEFAULT_DISPLAY_MANAGER" ] && HEED_DEFAULT_DISPLAY_MANAGER=true
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/bin/xdm
PIDFILE=/var/run/xdm.pid
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
# 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!
# Update: --name should prevent signalling innocent processes.
SSD_START_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --startas $DAEMON"
SSD_STOP_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --retry TERM/5/TERM/5"
SSD_RELOAD_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --signal 1"
case "$1" in
start)
if [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
[ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
[ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
echo "Not starting X display manager (xdm); it is not the default" \
"display manager."
else
log_daemon_msg "Starting X display manager" "xdm"
start-stop-daemon --start --quiet $SSD_START_ARGS \
|| log_progress_msg "already running"
log_end_msg 0
fi
;;
restart)
/etc/init.d/xdm stop
[ -f $PIDFILE ] && exit 1
/etc/init.d/xdm start
;;
reload)
log_daemon_msg "Reloading X display manager configuration..."
if ! start-stop-daemon --stop --quiet $SSD_RELOAD_ARGS; then
log_progress_msg "not running."
fi
log_end_msg 0
;;
force-reload)
/etc/init.d/xdm reload
;;
stop)
log_daemon_msg "Stopping X display manager" "xdm"
if ! [ -f $PIDFILE ]; then
log_progress_msg "not running ($PIDFILE not found)"
else
start-stop-daemon --stop --quiet $SSD_STOP_ARGS
SSD_RES=$?
if [ $SSD_RES -eq 1 ]; then
log_progress_msg "not running"
fi
if [ $SSD_RES -eq 2 ]; then
log_progress_msg "not responding to TERM signals"
else
if [ -f $PIDFILE ]; then
log_progress_msg "(removing stale $PIDFILE)"
rm $PIDFILE
fi
fi
fi
log_end_msg 0
;;
*)
echo "Usage: /etc/init.d/xdm {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0
# vim:set ai et sts=2 sw=2 tw=80:
More information about the Splashy-devel
mailing list