| Deutsch English Français Italiano |
|
<20240912173141.563@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.unix.shell Subject: Re: nohup Versus setsid Date: Fri, 13 Sep 2024 00:37:54 -0000 (UTC) Organization: A noiseless patient Spider Lines: 61 Message-ID: <20240912173141.563@kylheku.com> References: <vbtqcd$2sce$1@dont-email.me> <vbujqm$1t0jr$1@news.xmission.com> <vbul72$89jc$1@dont-email.me> <vbvod2$esm6$1@dont-email.me> <vbvs6r$7jlu$1@dont-email.me> Injection-Date: Fri, 13 Sep 2024 02:37:54 +0200 (CEST) Injection-Info: dont-email.me; posting-host="99dc7076b0b49591e69cd20e1421cb3c"; logging-data="540159"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19euhT+kJnQYt0yvwJWXNvfB3NVtwWVsvI=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:kK4Ab0Lm+7bjFQViskuoeIKEpjs= Bytes: 2987 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