Automatically restarted rdesktop after it closes

Matt Krause krausem at gmail.com
Mon Jul 12 21:14:24 UTC 2004


I am trying to figure out a way to automatically restart an rdesktop
session it the process dies or is logged off for some reason.

I have setup a script to ps -aux |grep rdesktop and if it doesn't
exist to fire up my session. It works great if you execute it from
command line, but I can't get it to run from cron.  /var/log/cron says
it is running, and no error messages are anywhere in the logs. At
first I thought maybe it is because it is an X application, so I tried
xterm -e rdesktop.... but that didn't work either.

I know this script is pretty crude. If anyone else can think of a
better way or a way to get it to run from cron, I would appreciate it.
Thanks.

#/bin/bash
TestVar=$(ps -aux | grep 192.168.5.80 | grep -v grep)
if [ -z "$TestVar" ]; then
       xterm -e /usr/bin/rdesktop -f -u user -p password 192.168.5.80
fi

I am also messing around with /etc/inittab and respawn but with no
luck as of yet.

Thanks. 
-- 
Matt Krause
krausem at gmail.com
http://www.mattkrause.net





More information about the users mailing list