summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2014-02-24 12:56:37 -0600
committerDarrell Anderson <humanreadable@yahoo.com>2014-02-24 12:56:37 -0600
commit77aed4a4eba63e760c40cc5b3d1ad556cad5c40f (patch)
treeee26a0d18c936352e69a3a93ea244c13d286949c
parent3545330be06081c9fdc2546bf465d9a2c5d24f75 (diff)
downloadtdebase-77aed4a4eba63e760c40cc5b3d1ad556cad5c40f.tar.gz
tdebase-77aed4a4eba63e760c40cc5b3d1ad556cad5c40f.zip
Add nominal preventive maintenance in starttde.
-rw-r--r--starttde16
1 files changed, 16 insertions, 0 deletions
diff --git a/starttde b/starttde
index 269d4ffa5..2308f6f9b 100644
--- a/starttde
+++ b/starttde
@@ -405,6 +405,17 @@ fi
dl=$DESKTOP_LOCKED
unset DESKTOP_LOCKED # Don't want it in the environment
+# Clean house in case a previous session was terminated abruptly.
+# When left hanging these two processes interfere with starting Trinity.
+DESKTOP_LOCK="`ps aux | grep $USER | grep kdesktop_lock | grep -v grep | awk '{print $2}'`"
+if [ "$DESKTOP_LOCK" != "" ]; then
+ kill -9 $DESKTOP_LOCK &>/dev/null
+fi
+DCOP="`ps aux | grep $USER | grep dcopserver | grep -v grep | awk '{print $2}'`"
+if [ "$DCOP" != "" ]; then
+ kill -9 $DCOP &>/dev/null
+fi
+
# Launch splash that doesn't need any TDE libraries here, before
# TDE libraries are loaded into memory (which may take some time
# with cold caches). Makes the splash appear sooner.
@@ -740,6 +751,11 @@ echo "[starttde] Shutting down Trinity..." 1>&2
$TDEDIR/bin/tdeinit_shutdown
$TDEDIR/bin/dcopserver_shutdown --wait
$TDEDIR/bin/artsshell -q terminate
+# Sometimes gamin prevents halting or rebooting a system. Just terminate the process now.
+GAM_SERVER="`ps aux | grep $USER | grep gam_server | grep -v grep | awk '{print $2}'`"
+if [ "$GAM_SERVER" != "" ]; then
+ kill -9 $GAM_SERVER 2>/dev/null
+fi
# KDE4 support.
if [ -f /usr/bin/kdeinit4_shutdown ]; then
/usr/bin/kde4 kdeinit4_shutdown 2>/dev/null