LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-20-2012, 05:51 AM   #1
SAPnet
LQ Newbie
 
Registered: Jul 2003
Posts: 15

Rep: Reputation: 0
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.
 
Old 08-20-2012, 09:23 PM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
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
 
1 members found this post helpful.
Old 08-21-2012, 04:31 AM   #3
SAPnet
LQ Newbie
 
Registered: Jul 2003
Posts: 15

Original Poster
Rep: Reputation: 0
Thumbs up

That works a treat, thanks very much!
 
Old 08-21-2012, 05:45 AM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by Ygrex View Post
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
 
Old 08-21-2012, 10:59 AM   #5
SAPnet
LQ Newbie
 
Registered: Jul 2003
Posts: 15

Original Poster
Rep: Reputation: 0
Added that in... cheers guys!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't seem to figure out how to script a simple closed loop blainemiller Linux - Newbie 7 07-20-2011 08:26 PM
[SOLVED] Cannot reopen Firefox TSquaredF Slackware 5 09-26-2009 07:12 PM
Shell script: Open program when closed? computer_freak_8 Programming 3 12-27-2008 08:13 AM
Does anyone know how to reopen a window closed due to a bug? InfinitePalindrome Linux - Newbie 14 06-13-2008 02:57 PM
Reopen the stdout and stderr rahul_kulkarni Programming 3 02-21-2005 06:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration