Re: Monitor mode handling (bug ?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ganael.

For nothing really!

Ganael Laplanche wrote in
 <2021198.x0N0T6uNKo@xxxxxxxxxxxxxxxxx>:
 |On Monday, January 16, 2023 8:41:14 PM CET Steffen Nurpmeso wrote:
 |> So i think i am out of ideas except doing what Jilles suggested
 |> in the message, enwrapping the inner thing with sh -c '..'.
 |> [...]
 |
 |Yes, I am afraid it's the only syntax that works (but it is not very 
 |convenient).
 |
 |I had to remove /dev/null redirections for stdin and stdout to avoid \
 |getting a 
 |"Cannot set tty process group (Operation not permitted)" error.

In the meantime i have taken over Jilles' commit to busybox ash,
hopefully correct, let's see whether it is taken.

 |Finally, that gives, on FreeBSD:
 |
 |$ cat ./test.sh
 |#!/usr/local/bin/dash
 |/usr/local/bin/dash -c '
 |    set -m
 |    (
 |      sleep 1
 |    ) &
 |    i=$!

I could avoid many problems by doing "set +m" here.  But not all.

 |    echo >&2 "inner Main shell has: $(ps -o pid,pgid $$)"
 |    echo >&2 "inner Sub-shell has: $(ps -o pid,pgid $i)"
 |    wait $i
 |'
 |echo "outer Main shell has: $(ps -o pid,pgid $$)"
 |
 |$ ./test.sh
 |inner Main shell has:   PID  PGID
 |20457 20457
 |inner Sub-shell has:   PID  PGID
 |20458 20458
 |outer Main shell has:   PID  PGID
 |20456 20456
 |
 |Thanks again for your help!

Ah, all on my side.  For example i find it disturbing that my
interactive shell (bash) exits when the script backgrounds the
recursive shell above via & .. it reads EOF, and without "set -o
ignoreeof" or jobbed job it goes home.  I would not have expected
this.  (If is start it via "./test.sh &" then ok, too.)
No expert, but at occasions Wheeler really helps out.

Ciao,

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux