Loop to keep rdesktop open

Hi guys.
I need some kind of a loop that will keep rdesktop active all the time after i start the xwindows. in other words i want it to reopen the rdesktop upon cancelling or closing by users. i tried wait but i could not get it to work. I am using slack ware with the basic tab manager xwindows.
Thank you
LVL 7
khashayar01Asked:
Who is Participating?
 
GnsCommented:
Ok, you run rdesktop from linux to a windoze terminal service of some kind (using RDP)? And want to make it respawn rdesktop upon close?
Assuming you start rdesktop from .xinitrc or similar... Instead of launching rdesktop directly like
...
rdesktop <arguments>&
twm
... (or however you have it set), make a little script that launch rdesktop inside a "forever loop", and launch that (still in the background, so that your X waits on a windowmanager or sessionmanager called later on) instead:
#!/bin/sh
# Forever loop to respawn rdesktop... note that nothing inside this script is backgrounded here... would be a potential forkbomb:-)

while true; do
  rdesktop <arguments>
done
# end of script
... saved to a file (lets say /usr/local/bin/foreverrdesktop) and chmoded (chmod +x /usr/local/bin/foreverrdesktop)
Then you can call
....
/usr/local/bin/forevermydesktop &
twm
... instead.

Or perhaps I missread your intent?

-- Glenn
0
 
ahoffmannCommented:
# try:
  xclock -digital -update 1
0
 
khashayar01Author Commented:
I tried that but what is it supposed to do?? it just gives me the clock
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
GnsCommented:
Argh "/usr/local/bin/forevermydesktop &" -> "/usr/local/bin/foreverrdesktop &"

-- Glenn (a.k.a. Le Grand Typo)
0
 
ahoffmannCommented:
oops, didn't read carefully ..
rdesktop will be started by the user, so simply write a shell for them which calls rdesktop in a infinite loop
0
 
GnsCommented:
Yes...:-)

-- Glenn
0
 
ahoffmannCommented:
Glenn has daylight again, and so is a few minutes faster than me ;-)
0
 
GnsCommented:
Oh yes, and a painful transition it was... Was up late patrying(! That doesn't happen often these days:)... And then played around a bit with my new x86_64 (fsc 800s... 3200+ with 1GiB RAM, SATA etc (vias sata, so I had to go with a 2.6 kernel and libsata)... perhaps made around your parts Achim?-)... Completely forgot my eldest sons scout initiation... And the daylight savings.... Talk about the Mother of all headaches:-). Not so fun pretending to be all enthusiatic about his ceremony:P.
Nice to see you a bit more active too Achim.

Sorry for this offtopic blurb khashayar01.

-- Glenn
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.