How does nohup work? [closed]

邮差的信 提交于 2019-12-07 01:32:43

问题


What is performed behind the scenes when a program runs with nohup?

Is the PID of the parent process being changed?

Thanks.

EDIT: I understood that nohup (and disown) causes that SIGHUP is not sent to the process if the parent process receives it. Does it mean that it is equivalent to handling SIGHUP (and actually ignore it)?


回答1:


Use the source, Luke!

(Extra characters added to keep the new answer length rules happy.)




回答2:


It is equivalent to setting the SIGHUP handler to SIG_IGN, ie.

signal(SIGHUP, SIG_IGN);



回答3:


The Wikipedia article about nohup explains it pretty well.



来源:https://stackoverflow.com/questions/3881771/how-does-nohup-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!