Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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.
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!!
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.