Short answer: because you’re a freaking idiot.
Long answer: My shell script is on a Linux server. I access via ssh using Putty. I run it from the command line, from Window #1, like this:
$ bin/myapp.sh &
when I close my ssh window. In Window #2, I watch the logs, and I can see that myapp.sh has exited. Specifically, it caught a SIGHUP.
How to fix this? Don’t close the window. Instead, exit from the ssh session by typing “exit”.
Short answer: I’m a freaking idiot.
3 Comments »
givemeascream
Jun 29, 2009 at 12:48 am
launching commands with nohup is also a good option
emailtoid.net/i/948f3a1b/…
Oct 20, 2009 at 4:55 pm
You should check out the “screen” command. It depends on the distro whether it’s installed by default or not, the package name is “screen”.
If you are inside a screen session, not only you can close the terminal window, you can re-attach to the session any time later, so you can check on the output of your long running program.
I write a (bit) more about screen here:
http://titan2x.com/productivity-tips.html
And my cheat sheet for screen’s key bindings is here:
http://wiki.titan2x.com/index.php?title=Screen_cheat_sheet
ralph
Dec 9, 2009 at 6:46 pm
with “screen” you already have to have it running beforehand. Another way is to background the job with ctrl-z and then “bg” command, then use “disown” command with process as argument, or percent and number for job, e.g. disown %1. But not as good as “screen”, you can’t re-attach to it later, have to kill it.
You must log in to post a comment.