LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Command / Script to launch xfreerdp and reopen if it is closed... (https://www.linuxquestions.org/questions/linux-general-1/command-script-to-launch-xfreerdp-and-reopen-if-it-is-closed-4175423037/)

SAPnet 08-20-2012 05:51 AM

Command / Script to launch xfreerdp and reopen if it is closed...
 
Hi,

To give a brief background, I am trying to create a thin client like install where a remote desktop session is automatically connected when a user logs in. I have got this bit working ok with an Open Suse install, IceWM and XFreeRDP (for some reason it will not work if the user is set to auto-login, but I digress...).

Currently if the session is closed (IE, the connection is lost or the user closes the RDP session) then the user must manually relaunch the RDP session. What I would like is for the session to automatically relaunch if it is closed.

I have seen something similar with Firefox on a kiosk like setup - but I have no idea how to implement it! I've tried having a look around the web but can't seem to find the right solution.

If anyone can shed any light I'd be greatly appreciated.

Oh, the command I run at login is:

Code:

xfreerdp -f xxx.xxx.xxx.xxx
Thanks,
Brad.

Ygrex 08-20-2012 09:23 PM

if it does not detach from terminal you can just loop it:
Code:

while (true); do xfreerdp -f xxx.xxx.xxx.xxx ; done
though it's application specific how to determine if it was closed intentionally

SAPnet 08-21-2012 04:31 AM

That works a treat, thanks very much! :)

Valery Reznic 08-21-2012 05:45 AM

Quote:

Originally Posted by Ygrex (Post 4759705)
if it does not detach from terminal you can just loop it:
Code:

while (true); do xfreerdp -f xxx.xxx.xxx.xxx ; done
though it's application specific how to determine if it was closed intentionally

I suggest to change it a bit:
Code:

while (true); do xfreerdp -f xxx.xxx.xxx.xxx ; sleep 2; done
In it's original form if xfreerdp for some reason failed to start you will have a very hard time killing this loop

SAPnet 08-21-2012 10:59 AM

Added that in... cheers guys!


All times are GMT -5. The time now is 04:57 AM.