In previous jobs and experiences, I used screen or nohup to run my long running jobs from my terminal screen. Most, if not all of my previous jobs' servers dropped you if it didn't detect any activity after X amount of time. Even if I had set ServerKeepAlive and other settings in my .ssh/config file, in some cases I still got booted, probably because the server ignored my settings. I used nohup once or twice but I mainly use screen to keep my process running.
Yesterday, I forgot to run my command with screen or nohup. I got booted off and I thought I was hosed. However, for some reason, the process was still running, even after several hours. I typed in ps -ef | grep myprocname
and it was there until it was completed. I didn't run my process in the background (not sure if that makes a difference). I just type in ./script.sh
and let it run.
What setting on the server allowed this fortuitous event to occur? I think the remote server is running Centos 6.4. Is this a Centos 6.4 thing, to not terminate processes when the parent process (in this case my ssh connection/shell) is killed? Do I need to go back to reading a Unix/Linux book since this is an easy question? Do I have my basic Unix facts wrong (about the parent process)? Did I get lucky?
nohup
does), it keeps running and is inherited by theinit
process. The new parent pid is 1. I can not say anything useful about your particular case though.