Just some stuff about me.
Here's my dotfiles repository.
What links here:
The nohup performs the following tricks:
that the SIGIGN is preserved after the execve() syscall..
Run the execve()..
All the above make the program immune to the SIGHUP signal and can’t fail due to writing to or reading from the closed terminal.
When a controlling process loses its terminal connection, the kernel sends a SIGHUP signal to inform it of this fact. Shell processes (which are usually control terminals) have a handler to catch SIGHUP signals. Receiving a signal starts a fan-out process of sending SIGHUP signals to all jobs it has created and know about (remember the fg, bg and waitpid()).
The default action for the SIGHUP is terminate. Inside a shell, a process group is usually called a job. In its turn, each process group belongs to a session
cat /var/log/nginx.log | grep string | head # a process group with 3 processes
signal can be sent to all members of a process group by using killpg() or kill() with a negative PGID parameter.
https://biriukov.dev/docs/fd-pipe-session-terminal/3-process-groups-jobs-and-sessions/