nelhage / reptyr

Reparent a running program to a new terminal
MIT License
5.77k stars 216 forks source link

reptyr group of processes? #79

Closed vlig closed 8 years ago

vlig commented 8 years ago

Using FreeBSD. I started make buildkernel KERNCONF=MYKERNEL, then all like in Typical usage pattern section. ps -aj now shows:

USER       PID  PPID  PGID SID JOBC STAT TT     TIME COMMAND
...
root      1101   914  1101 914    1 T     1  0:00,01 sudo make buildkernel KERNCONF=GATEWAY
root      1102  1101  1101 914    1 T     1  0:00,00 make buildkernel KERNCONF=GATEWAY
root      1107  1102  1101 914    1 T     1  0:00,01 make -m /usr/src/share/mk -f Makefile.inc1 ...
root     39714  1107  1101 914    1 T     1  0:00,36 make -m /usr/src/share/mk KERNEL=kernel ...
root     41545 39714  1101 914    1 T     1  0:00,00 cc -c -O2 -pipe -fno-strict-aliasing -std=c99 ...
root     41546 41545  1101 914    1 T     1  0:00,42 /usr/bin/cc -cc1 -triple x86_64-unknown-freebsd10.3 ...
...

Trying to reptyr 1101 or any other results in:

[-] Process 1101 shares a process group with 5 other processes. Unable to attach.

Unable to attach to pid 1101: Invalid argument

Is it possible to resume all processes at once?

nelhage commented 8 years ago

See the discussion on #24 and I think a few other issues; On Linux it's possible with the -T option, but that hasn't been ported to FreeBSD yet. Unfortunately, I don't know of an effective way to do this, due to quirks in how the termios subsystem is designed.