3
# look for GDM/KDM/LDM/XDM
4
# if one of them is used, then it has launched either the session-manager, or the stand-alone script, both blocking.
5
# so just take this one, and kill it so that we return to GDM.
6
gdm_proc=`pgrep "gdm|kdm|ldm|xdm" | tail -1`
7
if test -n "$gdm_proc"; then
8
last_process=`ps -ef | grep $gdm_proc | grep -v grep | tail -1 | tr -s " " | cut -d " " -f 2`
9
if test -n "$last_process"; then
15
# if the display manager couldn't be found, look for an endless sleep (likely to be the last process of the session), and kill it.
16
sleep_proc=`ps -ef | grep sleep | head -1`
17
if test -n "$sleep_proc"; then
18
sleep_time=`echo $sleep_proc | sed "s/.*sleep//g"`
19
if test $sleep_time -gt 3600; then