nelhage / reptyr

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

Hangup when running child processes #54

Open jmiserez opened 9 years ago

jmiserez commented 9 years ago

I am running a gedit instance from a terminal:

$ ps auf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
jeremie  14619  0.4  0.0  32032  7596 pts/1    Ss   00:37   0:00 bash
jeremie  14680 14.0  0.2 892612 48616 pts/1    Sl+  00:37   0:00  \_ gedit README.md

I then try to grab the underlying bash process:

./reptyr 14619

which works, but in the process it kills the running gedit instance:

$ ./reptyr 14860
[-] Timed out waiting for child stop.
Hangup

Not all commands react to the hangup in the same way though. E.g. sleep keeps on running in the previous terminal. Is the hangup intended?

Ulrar commented 7 years ago

So I just tried attaching to a resize2fs a colleague had started, I just got that :

[-] Timed out waiting for child stop.

Nothing else. Does that mean my resize2fs is dead in the background ? Kinda need to know, the client is waiting for this to finish ..

nelhage commented 7 years ago

@Ulrar does reptyr then exit with an error, ot what do you see after that? That error is itself mostly harmless; It's an attempt to ensure that the shell running the old process (if there is one) behaves properly, but we can often still attach if that fails (and the code attempts to do so)

Ulrar commented 7 years ago

No it just hangs. The resize2fs finished a few hours later and I had to kill reptyr, which was still running even though the process it was trying to attach didn't exist anymore.

No other shell if that matters, it had been disowned

Le 24 mai 2017 16:57, "Nelson Elhage" notifications@github.com a écrit :

@Ulrar https://github.com/ulrar does reptyr then exit with an error, ot what do you see after that? That error is itself mostly harmless; It's an attempt to ensure that the shell running the old process (if there is one) behaves properly, but we can often still attach if that fails (and the code attempts to do so)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nelhage/reptyr/issues/54#issuecomment-303768933, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1Tzwps6Vykp5gY0RIB1VtWAbV18iYyks5r9FNIgaJpZM4DnTyS .