LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-01-2007, 09:34 AM   #1
fftry
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Rep: Reputation: 0
starting X app over ssh


I have and access control application that runs on a pc. I would like to be able to restart the app from ssh on another computer. The application runs on X. I can kill the app fine from a remote ssh shell but how would I start it again?

For clarification:

accontrol: Computer that runs access control app in X11.
pc: Computer I use to login to accontrol via ssh.


I login to accontrol from pc and kill the app. I then want to restart the app. I would think I have to tell it to run the program somehow on tty1, not pts/0 or whatever my ssh login is. Just don't know how. Any ideas? X11 forwarding can't work since I don't want to run the application on pc.

Thanks,
gg
 
Old 08-01-2007, 09:39 AM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
You can direct the app to run on the display of the computer where it is coming from, hence DISPLAY:0.0. I'm not sure exactly, but I think you can change the environment variable DISPLAY variable to point to the ip:0.0 display of the machine. For example, connect via ssh then run 'export DISPLAY=192.168.0.1:0.0' the ip address is the one belonging to the machine running X. Then run the command. I may be wrong but I think you can redirect commands to remote displays. Google it.
 
Old 08-01-2007, 09:54 AM   #3
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
Actually the app is on local machine (accontrol).
Code:
ssh accontrol
DISPLAY=localhost:0 control_app_command
 
Old 08-01-2007, 10:45 AM   #4
fftry
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Original Poster
Rep: Reputation: 0
That does launch the app on the remote display. But the process is still spawned on the pts/0 tty. So when I close the ssh connection that process is killed. How can I get the proccess to remain even when I close the ssh connection?
 
Old 08-01-2007, 11:57 AM   #5
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
You may want to try running it in the background. For example, 'program &' then exit. Or use 'screen' then press Ctrl-d to exit then Ctrl-r to resume later on.
 
Old 08-01-2007, 12:58 PM   #6
fftry
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Original Poster
Rep: Reputation: 0
The "&" at the end of the command does not work since it is still bound to the tty and closes on disconnect, but screen did work. Thanks for the help. Case closed!!
 
Old 08-01-2007, 03:28 PM   #7
jlarsen
Member
 
Registered: Jan 2005
Location: Dallas, TX
Distribution: Slackware 14.1
Posts: 80

Rep: Reputation: 15
I've been able to get programs to continue to run by logging in with ssh as one user, then su to another user and running the program with the & then logging out. Can't remember if I logged in as root first or another user first though so you may have to try both (if it even makes a difference).
 
Old 08-02-2007, 02:13 AM   #8
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
ssh accontrol
export DISPLAY=localhost:0
nohup control_app_command
 
  


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
Dualhead (Xinerama): Starting app on specific screen? grayFalcon Linux - Newbie 2 07-22-2007 01:54 PM
Starting an app with increased priority. Patrick K Ubuntu 13 05-11-2007 03:41 PM
app that overrides IE from starting mimithebrain General 16 05-30-2006 12:42 AM
Starting An App From A Command-line linuxdawg Linux - Newbie 5 02-02-2005 09:06 AM
Starting a KDE app minimised? SMurf7 Linux - Newbie 3 03-08-2004 07:39 PM

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

All times are GMT -5. The time now is 07:28 PM.

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