프로그램/ubuntu

Linux - Background process to NOHUP status

mulderu 2017. 2. 17. 20:05


나의 프로세스를 살리자...


리눅스에서 터미널을 나올경우 이전에 실행했던  프로세서가 죽는다.. (백그라운드 포함)

참 허잡한 실수였음....


그럴경우 아래와 같이  백그라운드로 보내고 disown -h %1  이렇게 하여 계속 돌도록 할 수 있다.

ref : http://stackoverflow.com/questions/625409/how-do-i-put-an-already-running-process-under-nohup



Using the Job Control of bash to send the process into the background:

  1. Ctrl+Z to stop (pause) the program and get back to the shell.
  2. bg to run it in the background.
  3. disown -h [job-spec] where [job-spec] is the job number (like %1 for the first running job; find about your number with the jobs command) so that the job isn't killed when the terminal closes.