D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] ssh and programs (not) continuing to run

 

Not so much a question, as wondering whether what I observed
empirically somehow makes sense.

When I ssh into a remote server and run a program and then the
connection is terminated (because of a connection issue, or because
ssh is killed), the program dies too. Even if it was running in the
background.

However, when I do the same but manually exit the ssh connection after
making the program run in the background, the program continues to
run.

So:
ssh me@remote
foo.sh &
[connection dies]
[foo.sh dies too]

But
ssh me@remote
foo.sh &
exit
[foo.sh is still running]

Does this make sense?

Martijn.

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq