Clean up tdm-trinity ini script on Debian

pull/3/head
Timothy Pearson 12 years ago
parent b7620af060
commit f9dacdc567

@ -15,6 +15,9 @@
# #
# description: TDE Display Manager # description: TDE Display Manager
# #
. /lib/lsb/init-functions
set -e set -e
# To start tdm-trinity even if it is not the default display manager, change # To start tdm-trinity even if it is not the default display manager, change
@ -110,11 +113,16 @@ case "$1" in
if [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] && if [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
[ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] && [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
[ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
echo "Not starting TDE Display Manager (tdm-trinity); it is not the default display manager." log_warning_msg "Not starting TDE Display Manager (tdm-trinity); it is not the default display manager."
log_action_end_msg 0
else else
echo -n "Starting TDE Display Manager: tdm-trinity" log_action_begin_msg "Starting TDE Display Manager: tdm-trinity"
start-stop-daemon --start --quiet $SSD_ARGS -- $ARG || echo -n " already running" if start-stop-daemon --start --quiet $SSD_ARGS -- $ARG; then
echo "." log_action_end_msg 0
else
log_action_end_msg 0
log_warning_msg "TDE Display Manager tdm-trinity already running"
fi
fi fi
;; ;;
@ -129,11 +137,12 @@ case "$1" in
;; ;;
reload) reload)
echo -n "Reloading TDE Display Manager configuration..." log_action_begin_msg "Reloading TDE Display Manager configuration..."
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
echo "done." log_action_end_msg 0
else else
echo "tdm-trinity not running." log_action_end_msg 1
log_failure_msg "tdm-trinity not running."
fi fi
;; ;;
@ -142,9 +151,10 @@ case "$1" in
;; ;;
stop) stop)
echo -n "Stopping TDE Display Manager: tdm-trinity" log_action_begin_msg "Stopping TDE Display Manager: tdm-trinity"
if [ ! -f $PIDFILE ]; then if [ ! -f $PIDFILE ]; then
echo " not running ($PIDFILE not found)." log_action_end_msg 0
log_failure_msg "TDE Display Manager tdm-trinity not running ($PIDFILE not found)."
exit 0 exit 0
else else
DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]') DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]')
@ -154,7 +164,8 @@ case "$1" in
# give tdm's signal handler a second to catch its breath # give tdm's signal handler a second to catch its breath
sleep 1 sleep 1
else else
echo -n " not running" log_action_end_msg 0
log_failure_msg "TDE Display Manager tdm-trinity not running"
fi fi
fi fi
while [ $KILLCOUNT -le 5 ]; do while [ $KILLCOUNT -le 5 ]; do
@ -167,12 +178,13 @@ case "$1" in
KILLCOUNT=$(( $KILLCOUNT + 1 )) KILLCOUNT=$(( $KILLCOUNT + 1 ))
done done
if stillrunning; then if stillrunning; then
echo -n " not responding to TERM signal (pid $DAEMONPID)" log_action_end_msg 1
log_failure_msg "TDE Display Manager tdm-trinity not responding to TERM signal (pid $DAEMONPID)"
else else
rm -f $UPGRADEFILE rm -f $UPGRADEFILE
fi fi
fi fi
echo "." log_action_end_msg 0
# Launches usplash on shutdown # Launches usplash on shutdown
if ( `grep -q '\( \|^\)splash\( \|$\)' /proc/cmdline` && `which usplash_down >/dev/null` ) ; then if ( `grep -q '\( \|^\)splash\( \|$\)' /proc/cmdline` && `which usplash_down >/dev/null` ) ; then

@ -15,6 +15,9 @@
# #
# description: TDE Display Manager # description: TDE Display Manager
# #
. /lib/lsb/init-functions
set -e set -e
# To start tdm-trinity even if it is not the default display manager, change # To start tdm-trinity even if it is not the default display manager, change
@ -110,11 +113,16 @@ case "$1" in
if [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] && if [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
[ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] && [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
[ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
echo "Not starting TDE Display Manager (tdm-trinity); it is not the default display manager." log_warning_msg "Not starting TDE Display Manager (tdm-trinity); it is not the default display manager."
log_action_end_msg 0
else else
echo -n "Starting TDE Display Manager: tdm-trinity" log_action_begin_msg "Starting TDE Display Manager: tdm-trinity"
start-stop-daemon --start --quiet $SSD_ARGS -- $ARG || echo -n " already running" if start-stop-daemon --start --quiet $SSD_ARGS -- $ARG; then
echo "." log_action_end_msg 0
else
log_action_end_msg 0
log_warning_msg "TDE Display Manager tdm-trinity already running"
fi
fi fi
;; ;;
@ -129,11 +137,12 @@ case "$1" in
;; ;;
reload) reload)
echo -n "Reloading TDE Display Manager configuration..." log_action_begin_msg "Reloading TDE Display Manager configuration..."
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
echo "done." log_action_end_msg 0
else else
echo "tdm-trinity not running." log_action_end_msg 1
log_failure_msg "tdm-trinity not running."
fi fi
;; ;;
@ -142,9 +151,10 @@ case "$1" in
;; ;;
stop) stop)
echo -n "Stopping TDE Display Manager: tdm-trinity" log_action_begin_msg "Stopping TDE Display Manager: tdm-trinity"
if [ ! -f $PIDFILE ]; then if [ ! -f $PIDFILE ]; then
echo " not running ($PIDFILE not found)." log_action_end_msg 0
log_failure_msg "TDE Display Manager tdm-trinity not running ($PIDFILE not found)."
exit 0 exit 0
else else
DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]') DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]')
@ -154,7 +164,8 @@ case "$1" in
# give tdm's signal handler a second to catch its breath # give tdm's signal handler a second to catch its breath
sleep 1 sleep 1
else else
echo -n " not running" log_action_end_msg 0
log_failure_msg "TDE Display Manager tdm-trinity not running"
fi fi
fi fi
while [ $KILLCOUNT -le 5 ]; do while [ $KILLCOUNT -le 5 ]; do
@ -167,12 +178,13 @@ case "$1" in
KILLCOUNT=$(( $KILLCOUNT + 1 )) KILLCOUNT=$(( $KILLCOUNT + 1 ))
done done
if stillrunning; then if stillrunning; then
echo -n " not responding to TERM signal (pid $DAEMONPID)" log_action_end_msg 1
log_failure_msg "TDE Display Manager tdm-trinity not responding to TERM signal (pid $DAEMONPID)"
else else
rm -f $UPGRADEFILE rm -f $UPGRADEFILE
fi fi
fi fi
echo "." log_action_end_msg 0
# Launches usplash on shutdown # Launches usplash on shutdown
if ( `grep -q '\( \|^\)splash\( \|$\)' /proc/cmdline` && `which usplash_down >/dev/null` ) ; then if ( `grep -q '\( \|^\)splash\( \|$\)' /proc/cmdline` && `which usplash_down >/dev/null` ) ; then

@ -15,6 +15,9 @@
# #
# description: TDE Display Manager # description: TDE Display Manager
# #
. /lib/lsb/init-functions
set -e set -e
# To start tdm-trinity even if it is not the default display manager, change # To start tdm-trinity even if it is not the default display manager, change
@ -110,11 +113,16 @@ case "$1" in
if [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] && if [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
[ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] && [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
[ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
echo "Not starting TDE Display Manager (tdm-trinity); it is not the default display manager." log_warning_msg "Not starting TDE Display Manager (tdm-trinity); it is not the default display manager."
log_action_end_msg 0
else else
echo -n "Starting TDE Display Manager: tdm-trinity" log_action_begin_msg "Starting TDE Display Manager: tdm-trinity"
start-stop-daemon --start --quiet $SSD_ARGS -- $ARG || echo -n " already running" if start-stop-daemon --start --quiet $SSD_ARGS -- $ARG; then
echo "." log_action_end_msg 0
else
log_action_end_msg 0
log_warning_msg "TDE Display Manager tdm-trinity already running"
fi
fi fi
;; ;;
@ -129,11 +137,12 @@ case "$1" in
;; ;;
reload) reload)
echo -n "Reloading TDE Display Manager configuration..." log_action_begin_msg "Reloading TDE Display Manager configuration..."
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
echo "done." log_action_end_msg 0
else else
echo "tdm-trinity not running." log_action_end_msg 1
log_failure_msg "tdm-trinity not running."
fi fi
;; ;;
@ -142,9 +151,10 @@ case "$1" in
;; ;;
stop) stop)
echo -n "Stopping TDE Display Manager: tdm-trinity" log_action_begin_msg "Stopping TDE Display Manager: tdm-trinity"
if [ ! -f $PIDFILE ]; then if [ ! -f $PIDFILE ]; then
echo " not running ($PIDFILE not found)." log_action_end_msg 0
log_failure_msg "TDE Display Manager tdm-trinity not running ($PIDFILE not found)."
exit 0 exit 0
else else
DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]') DAEMONPID=$(cat $PIDFILE | tr -d '[:blank:]')
@ -154,7 +164,8 @@ case "$1" in
# give tdm's signal handler a second to catch its breath # give tdm's signal handler a second to catch its breath
sleep 1 sleep 1
else else
echo -n " not running" log_action_end_msg 0
log_failure_msg "TDE Display Manager tdm-trinity not running"
fi fi
fi fi
while [ $KILLCOUNT -le 5 ]; do while [ $KILLCOUNT -le 5 ]; do
@ -167,12 +178,13 @@ case "$1" in
KILLCOUNT=$(( $KILLCOUNT + 1 )) KILLCOUNT=$(( $KILLCOUNT + 1 ))
done done
if stillrunning; then if stillrunning; then
echo -n " not responding to TERM signal (pid $DAEMONPID)" log_action_end_msg 1
log_failure_msg "TDE Display Manager tdm-trinity not responding to TERM signal (pid $DAEMONPID)"
else else
rm -f $UPGRADEFILE rm -f $UPGRADEFILE
fi fi
fi fi
echo "." log_action_end_msg 0
# Launches usplash on shutdown # Launches usplash on shutdown
if ( `grep -q '\( \|^\)splash\( \|$\)' /proc/cmdline` && `which usplash_down >/dev/null` ) ; then if ( `grep -q '\( \|^\)splash\( \|$\)' /proc/cmdline` && `which usplash_down >/dev/null` ) ; then

Loading…
Cancel
Save