Commit e5b7c66
committed
fix: remove Setsid from runWithoutReap to restore TTY
Commit 2ca0537 introduced Setsid=true in runWithoutReap(), which
creates a new session for the child process and detaches it from the
controlling terminal. This causes bash to fail with:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
Setsid is only needed in runAndReap() where rootlesskit acts as init
and needs session isolation for zombie reaping via Wait4(-1, ...).
In the non-reaping path, the child should inherit the parent session
to retain access to the TTY.
Pdeathsig (PR_SET_PDEATHSIG) does not require Setsid.
An integration test for runWithoutReap is added to prevent
regressions.
Fixes #557
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>1 parent 050dfb2 commit e5b7c66
3 files changed
Lines changed: 44 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
545 | | - | |
546 | 545 | | |
547 | 546 | | |
548 | 547 | | |
| |||
0 commit comments