Re: nohup Versus setsid

Liste des GroupesRevenir à cu shell 
Sujet : Re: nohup Versus setsid
De : nn.throttle (at) *nospam* xoxy.net (Helmut Waitzmann)
Groupes : comp.unix.shell
Date : 13. Sep 2024, 18:00:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <83wmjf1oaq.fsf@helmutwaitzmann.news.arcor.de>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
 Lawrence D'Oliveiro <ldo@nz.invalid>:
It has long seemed to me that nohup(1) was an old, hacky way of doing what can be done more elegantly using setsid(1). Compare the docs for yourself <https://manpages.debian.org/1/nohup.1.en.html> vs <https://manpages.debian.org/1/setsid.1.en.html>, and tell me why we still need nohup when we have setsid? >
 Because there is a real difference between both of them.  "nohup" makes the invoked command immune to the HUP signal but  lets it remain in its terminal session, i. e. the command to be  run will not lose its controlling terminal.  Thus the other job  control signals like TSTP, INT, and QUIT sent by the terminal  driver to the command may have their effects.  Also, the HUP signal will be ignored regardless of its origin  (terminal driver as well as the "kill(2)" system call).  If, on the other hand, you use "setsid", the command to be run  will not be made immune to any of the job control signals,  i. e. any job control signal sent to the command to be run by  means of the kill(2) system call will have its effect.  Also, as the command to be run will leave the terminal session  and thus lose the controlling terminal of the invoker, it won't  be affected by any job control signal sent by the terminal driver  of the invoker's controlling terminal, for example when typing  the interrupt, suspend or quit key on the keyboard no signal will  reach the command to be invoked.
Date Sujet#  Auteur
12 Sep 24 * nohup Versus setsid14Lawrence D'Oliveiro
12 Sep 24 +* Re: nohup Versus setsid9Kenny McCormack
12 Sep 24 i`* Re: nohup Versus setsid8Janis Papanagnou
13 Sep 24 i `* Re: nohup Versus setsid7Lawrence D'Oliveiro
13 Sep 24 i  `* Re: nohup Versus setsid6vallor
13 Sep 24 i   +* Re: nohup Versus setsid4Lawrence D'Oliveiro
13 Sep 24 i   i`* Re: nohup Versus setsid3Janis Papanagnou
13 Sep 24 i   i `* Re: nohup Versus setsid2Helmut Waitzmann
13 Sep 24 i   i  `- Re: nohup Versus setsid1Janis Papanagnou
13 Sep 24 i   `- Re: nohup Versus setsid1Kaz Kylheku
12 Sep 24 +- Re: nohup Versus setsid1Kaz Kylheku
13 Sep 24 `* Re: nohup Versus setsid3Helmut Waitzmann
13 Sep 24  +- Re: nohup Versus setsid1Kaz Kylheku
14 Sep 24  `- Re: nohup Versus setsid1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal