|
|
|
@ -1,16 +1,16 @@
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
|
# Provides: x-display-manager tdm-trinity
|
|
|
|
|
# Provides: x-display-manager tdm
|
|
|
|
|
# Required-Start: $local_fs $remote_fs
|
|
|
|
|
# Required-Stop: $local_fs $remote_fs
|
|
|
|
|
# Should-Start: console-screen kbd acpid hal krb5-kdc nis
|
|
|
|
|
# Should-Start: console-screen kbd acpid hal krb5-kdc ypbind
|
|
|
|
|
# Should-Stop: console-screen kbd
|
|
|
|
|
# Default-Start: 2 3 4 5
|
|
|
|
|
# Default-Stop: 0 1 6
|
|
|
|
|
# Short-Description: X display manager for Trinity
|
|
|
|
|
# Description: TDM manages a collection of X servers, which may be on the local host or remote machines.
|
|
|
|
|
### END INIT INFO
|
|
|
|
|
# /etc/init.d/tdm-trinity: start or stop the X display manager
|
|
|
|
|
# /etc/init.d/tdm: start or stop the X display manager
|
|
|
|
|
# Script originally stolen from the xdm package
|
|
|
|
|
#
|
|
|
|
|
# description: Trinity Display Manager
|
|
|
|
@ -20,7 +20,7 @@
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# To start tdm-trinity even if it is not the default display manager, change
|
|
|
|
|
# To start tdm even if it is not the default display manager, change
|
|
|
|
|
# HEED_DEFAULT_DISPLAY_MANAGER to "false."
|
|
|
|
|
HEED_DEFAULT_DISPLAY_MANAGER=true
|
|
|
|
|
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
|
|
|
|
@ -114,27 +114,27 @@ case "$1" in
|
|
|
|
|
if [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
|
|
|
|
|
[ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
|
|
|
|
|
[ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
|
|
|
|
|
log_warning_msg "Not starting Trinity Display Manager (tdm-trinity); it is not the default display manager."
|
|
|
|
|
log_warning_msg "Not starting Trinity Display Manager (tdm); it is not the default display manager."
|
|
|
|
|
log_action_end_msg 0
|
|
|
|
|
else
|
|
|
|
|
log_action_begin_msg "Starting Trinity Display Manager: tdm-trinity"
|
|
|
|
|
log_action_begin_msg "Starting Trinity Display Manager: tdm"
|
|
|
|
|
if start-stop-daemon --start --quiet $SSD_ARGS -- $ARG; then
|
|
|
|
|
log_action_end_msg 0
|
|
|
|
|
else
|
|
|
|
|
log_action_end_msg 0
|
|
|
|
|
log_warning_msg "Trinity Display Manager tdm-trinity already running"
|
|
|
|
|
log_warning_msg "Trinity Display Manager (tdm) already running"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
restart)
|
|
|
|
|
/etc/init.d/tdm-trinity stop
|
|
|
|
|
/etc/init.d/tdm stop
|
|
|
|
|
if [ -f $PIDFILE ]; then
|
|
|
|
|
if stillrunning; then
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
/etc/init.d/tdm-trinity start
|
|
|
|
|
/etc/init.d/tdm start
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
reload)
|
|
|
|
@ -143,19 +143,19 @@ case "$1" in
|
|
|
|
|
log_action_end_msg 0
|
|
|
|
|
else
|
|
|
|
|
log_action_end_msg 1
|
|
|
|
|
log_failure_msg "tdm-trinity not running."
|
|
|
|
|
log_failure_msg "tdm not running."
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
force-reload)
|
|
|
|
|
/etc/init.d/tdm-trinity reload
|
|
|
|
|
/etc/init.d/tdm reload
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
stop)
|
|
|
|
|
log_action_begin_msg "Stopping Trinity Display Manager: tdm-trinity"
|
|
|
|
|
log_action_begin_msg "Stopping Trinity Display Manager: tdm"
|
|
|
|
|
if [ ! -f $PIDFILE ]; then
|
|
|
|
|
log_action_end_msg 0
|
|
|
|
|
log_failure_msg "Trinity Display Manager tdm-trinity not running ($PIDFILE not found)."
|
|
|
|
|
log_failure_msg "Trinity Display Manager (tdm) not running ($PIDFILE not found)."
|
|
|
|
|
exit 0
|
|
|
|
|
else
|
|
|
|
|
DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]')
|
|
|
|
@ -166,7 +166,7 @@ case "$1" in
|
|
|
|
|
sleep 1
|
|
|
|
|
else
|
|
|
|
|
log_action_end_msg 0
|
|
|
|
|
log_failure_msg "Trinity Display Manager tdm-trinity not running"
|
|
|
|
|
log_failure_msg "Trinity Display Manager (tdm) not running"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
while [ $KILLCOUNT -le 5 ]; do
|
|
|
|
@ -180,7 +180,7 @@ case "$1" in
|
|
|
|
|
done
|
|
|
|
|
if stillrunning; then
|
|
|
|
|
log_action_end_msg 1
|
|
|
|
|
log_failure_msg "Trinity Display Manager tdm-trinity not responding to TERM signal (pid $DAEMONPID)"
|
|
|
|
|
log_failure_msg "Trinity Display Manager (tdm) not responding to TERM signal (pid $DAEMONPID)"
|
|
|
|
|
else
|
|
|
|
|
rm -f $UPGRADEFILE
|
|
|
|
|
fi
|
|
|
|
@ -194,7 +194,7 @@ case "$1" in
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
*)
|
|
|
|
|
echo "Usage: /etc/init.d/tdm-trinity {start|stop|restart|reload|force-reload}"
|
|
|
|
|
echo "Usage: /etc/init.d/tdm {start|stop|restart|reload|force-reload}"
|
|
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|