Re: nohup Versus setsid

Liste des GroupesRevenir à cu shell 
Sujet : Re: nohup Versus setsid
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shell
Date : 13. Sep 2024, 02:37:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240912173141.563@kylheku.com>
References : 1 2 3 4 5
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-09-12, vallor <vallor@cultnix.org> wrote:
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[*].

I have this:

  $ time -p make -j64 | pw &

Where pw is PipeWatch: https://www.kylheku.com/cgit/pw/about/

pw continuously reads its input, and refreshes the terminal
with samples of the input.

When pw is put into the job control background, it knows this,
and avoids writing to the terminal, while continuing to read
standard input, and performing its activities like capturing
triggered snapshots.

When you foreground it, the display refreshes.

pw is not a pager; it does not buffer everything and does not
let you scroll through the history. It captures terminal-window-sized
snapshots consisting of lines.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

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