Re: nohup Versus setsid

Liste des GroupesRevenir à cu shell 
Sujet : Re: nohup Versus setsid
De : vallor (at) *nospam* cultnix.org (vallor)
Groupes : comp.unix.shell
Date : 13. Sep 2024, 00:07:07
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbvs6r$7jlu$1@dont-email.me>
References : 1 2 3 4
User-Agent : Pan/0.160 (Toresk; f2b262f; Linux-6.11.0-rc7)
On Thu, 12 Sep 2024 22:02:10 -0000 (UTC), Lawrence D'Oliveiro wrote:

On Thu, 12 Sep 2024 14:01:37 +0200, Janis Papanagnou wrote:
 
In article <vbtqcd$2sce$1@dont-email.me>,
Lawrence D'Oliveiro  <ldo@nz.invalid> wrote:
>
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).
 
I don't know the details, but the descriptions look quite different...
nohup - run a command immune to hangups, with output to a non-tty
setsid - run a program in a new session
 
The effect is supposed to be the same: spawn a background task that will
continue running after you log out.

That's not the only thing that the (POSIX) nohup(1) tool does.

I prefer the simplicity of nohup's behavior, and use it when doing
"big" compiles.

I have a script:
$ cat go.sh
time -p make -j64

So I can:
$ nohup ./go.sh &

Then I can watch for status without flooding the terminal:

$ while : ; do tail nohup.out ; date; sleep 5 ; done

Everybody has their own way of doing things, but this works
on any POSIX system, not just Linux[*].

[*] Though, truth be told, I'm mostly using it to
compile Linux.

--
-Scott System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
   OS: Linux 6.11.0-rc7 Release: Mint 21.3 Mem: 258G
   "E Pluribus UNIX."

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