If I was running a command before the SSH connection was dropped, will the command continue executing?
|
In most cases, no. Processes will be sent a SIGHUP on loss of terminal. You can prefix a command with 'nohup' to ignore the signal. See: |
|||
|
|
|
Not generally, although not knowing what shell or even what OS you're running, it's tough to say. If you were running it under screen, for example, I think the behavior is to detach and continue running. Maybe some other shells have that as a configurable option. |
|||||
|
|
As Warner says above, the child of the ssh daemon (that is the login shell and it's children) will get As Warner also said, the process can choose to ignore |
|||
|
|
|
I'll add another heplful suggestion to the thread, something I just learned few minutes ago: If you already started a process that will take a long time (tar restore in my case), and forgot to include nohup in front of it, you can still prevent it from terminating on logoff. Here are the steps:
|
|||
|
|
Warner's answer is spot on. Alternately, you could also execute the command in the background, by appending an ampersand (&) to the end of the command. |
|||
|
|