Which methods exist to keep a command that was started from shell on running after logging out from from shell?
4 Answers
To put the application into the background, use
&:command &If you wish to close the terminal, and keep the application running, you can use several options:
screen,
dtachand
nohup.nohup command &Screen is helpful as you can re-start a session and dtach is fun as well.
Look at the following links for more informations
A useful (bash?) command is disown. the nice thing about it is that it works for an already running job (by the way, you disown jobs, not processes, so you need to do a ctrl-Z, bg before running disown on your job. For example, imagine yourself doing the following:
local % ssh some.where.com
remote % verylongscript.shNow you realize that you need to go but don't want the script to be killed upon exiting, so you
ctrl-Z
remote % bg
remote % disown
remote % exit
local %Now, on remote, your script is still running.
Use the nohup command like this:
nohup gedit /home/user/file.txt & 1 I use
nohup mycommand &For example to bring up a VirtualBox virtual server I type the following in a remote shell (which I close then):
nohup VBoxHeadless --startvm "myvm" --vrdp=off &