Loop to keep rdesktop open

Posted on 2004-03-26
Last Modified: 2013-12-27
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
Question by:khashayar01
  • 4
  • 3
LVL 51

Expert Comment

ID: 10696559
# try:
  xclock -digital -update 1

Author Comment

ID: 10704092
I tried that but what is it supposed to do?? it just gives me the clock
LVL 20

Accepted Solution

Gns earned 125 total points
ID: 10704236
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>&
... (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:
# Forever loop to respawn rdesktop... note that nothing inside this script is backgrounded here... would be a potential forkbomb:-)

while true; do
  rdesktop <arguments>
# 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 &
... instead.

Or perhaps I missread your intent?

-- Glenn
LVL 20

Expert Comment

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

-- Glenn (a.k.a. Le Grand Typo)
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

LVL 51

Expert Comment

ID: 10704268
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
LVL 20

Expert Comment

ID: 10704322

-- Glenn
LVL 51

Expert Comment

ID: 10704448
Glenn has daylight again, and so is a few minutes faster than me ;-)
LVL 20

Expert Comment

ID: 10704513
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap ( Version 1.2 2.      Jpcap( Version 0.6 Prerequisite: 1.      GCC …
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now