public inbox for dash@vger.kernel.org
 help / color / mirror / Atom feed
From: Ganael Laplanche <ganael.laplanche@martymac.org>
To: Steffen Nurpmeso <steffen@sdaoden.eu>
Cc: Jilles Tjoelker <jilles@stack.nl>, dash@vger.kernel.org
Subject: Re: Monitor mode handling (bug ?)
Date: Mon, 16 Jan 2023 12:15:52 +0100	[thread overview]
Message-ID: <2616938.TYJnH3iKXO@home.martymac.org> (raw)
In-Reply-To: <20230113210335.lQ0hq%steffen@sdaoden.eu>

On Friday, January 13, 2023 10:03:35 PM CET Steffen Nurpmeso wrote:

Hello Steffen,

> Well i mean, in spirit of Wheeler's "anything is possible with
> (one more) indirection" it could be possible nonetheless?
> [...]

Well, my initial examples then become :

$ cat test_ko.sh
set -m
$ dash test_ko.sh &
[1]  + suspended (tty input)  dash test_ko.sh

$ cat test_ok.sh
(
  set -m
)
$ dash test_ok.sh &
[1]  + done       dash test_ok.sh

It is not clear for me why that extra fork fixes the problem, but it works, 
thanks!

Unfortunately, my initial goal is to get a new process group for later 
children processes, but FreeBSD's sh (as well as dash) requires 'set -m' to be 
executed from the first process [1]. The extra fork breaks that requirement. 
The following example shows that the new process' PGID remains the same as the 
initial shell:

$ cat test_pgid.sh
(
  set -m
  (
    sleep 1
  ) &
  i=$!
  echo "Main shell has: $(ps -o pid,pgid $$)"
  echo "Sub-shell has: $(ps -o pid,pgid $i)"
  wait $i
)
$ dash test_pgid.sh &
Main shell has:   PID  PGID
10362 10362
Sub-shell has:   PID  PGID
10364 10362
[1]  + done       dash test_pgid.sh

So I am afraid the 'extra fork' tip is not useable for me...

Cheers,

Ganael.

[1] Discussed here: https://lists.freebsd.org/archives/freebsd-hackers/2022-March/000924.html

-- 
Ganael LAPLANCHE <ganael.laplanche@martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac@FreeBSD.org>, http://www.FreeBSD.org



  reply	other threads:[~2023-01-16 11:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 15:18 Monitor mode handling (bug ?) Ganael Laplanche
2023-01-10 21:28 ` Jilles Tjoelker
2023-01-11 16:25   ` Ganael Laplanche
2023-01-11 16:37     ` Ganael Laplanche
2023-01-11 17:31       ` Steffen Nurpmeso
2023-01-12 11:40         ` Ganael Laplanche
2023-01-12 15:00           ` Steffen Nurpmeso
2023-01-13 11:44             ` Ganael Laplanche
2023-01-13 21:03               ` Steffen Nurpmeso
2023-01-16 11:15                 ` Ganael Laplanche [this message]
2023-01-16 19:41                   ` Steffen Nurpmeso
2023-01-17 15:05                     ` Ganael Laplanche
2023-01-17 21:04                       ` Steffen Nurpmeso
2023-01-18 11:40                         ` Ganael Laplanche
2023-01-18 12:03                           ` Ganael Laplanche
2023-01-18 23:15                           ` Steffen Nurpmeso
2023-01-19 11:38                             ` Ganael Laplanche
2023-01-19 18:33                               ` Steffen Nurpmeso
2023-01-20 11:40                                 ` Ganael Laplanche
2023-01-27 10:21                                 ` Herbert Xu
2023-01-27 11:46                                   ` Ganael Laplanche
2023-01-30  7:21                                     ` Herbert Xu
2023-01-30 11:37                                       ` Ganael Laplanche
2023-01-31  3:20                                         ` Herbert Xu
2023-01-31 11:46                                           ` Ganael Laplanche
2023-03-08 11:47                                             ` Ganael Laplanche
2023-03-08 17:00                                               ` Steffen Nurpmeso
2023-03-09  5:55                                               ` Herbert Xu
2023-03-09  6:40                                                 ` Ganael Laplanche
2023-03-09  9:22                                                   ` Herbert Xu
2023-03-09  9:55                                                     ` Herbert Xu
2023-03-09 11:34                                                       ` Ganael Laplanche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2616938.TYJnH3iKXO@home.martymac.org \
    --to=ganael.laplanche@martymac.org \
    --cc=dash@vger.kernel.org \
    --cc=jilles@stack.nl \
    --cc=steffen@sdaoden.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox