Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does nohup work? [closed]

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)?

like image 801
rkellerm Avatar asked Feb 03 '23 01:02

rkellerm


2 Answers

Use the source, Luke!

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

like image 147
Blrfl Avatar answered Feb 05 '23 16:02

Blrfl


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

signal(SIGHUP, SIG_IGN);
like image 26
Hasturkun Avatar answered Feb 05 '23 14:02

Hasturkun