I have some job to run which need be attached to terminal (or in foreground). The job is run in remote servers, and needs keep running after the users logout. I am aware of vnc server, however, I want to know if there is any builtin tool in redhat that can work this out. (that is, I dont have sudo to install extra software).
|
|
|||
| show 2 more comments |
|
GNU screen is what you're looking for. It's pre-installed on all *nix systems I've used, so should be on Red Hat. If your ssh connection breaks unpredictably, your previous running command won't know about it and will continue to run as normal. You might have 10 different programs running in 10 different tabs within screen, and they'll all continue to run. You can then reattach (after logging in), with a few different variants of the same command - the one I use is:-
This means to reattach your previous screen session to the current terminal, and IIRC detaches whatever other client(s) might still be connected. To send a command to Screen has been around for a long time, so there are newer alternatives. I switched to tmux a year or so ago, and haven't looked back. This probably would require compiling, but it allows vertical split screen, which is the main reason why I favour it. The above solutions sidestep your question though. They provide you with solutions provided you haven't started your program yet. If you have a long running program which wasn't created within a |
|||
|
|
|
To start a "hidden" foreground terminal: ssh server.com -t screen -S applicationName [/usr/bin/executable] To detach (hide): CTRL+A D |
|||
|
|
ssh -t, it is the local terminal that is attached... the job could get interrupted if I logout locally. – Richard Oct 4 '12 at 19:28