New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work for processes which have spawned subprocesses #24
Comments
No updates? This is showstopper for pretty much any shell process that does something.. Being able to use reptyr would be great to be able to reattach to long running shell scripts remotely/safely... (once you figure out they are taking too long)... |
It'll be really good to develop this feature. therealprologic commented a year ago... |
Yeah, I'd really love to have this feature, but I've given it a bunch of thought and experimentation, and don't know of a robust way to do it with the operations Linux gives you. I came up with a completely different approach involving stealing the pty, but unfortunately it won't work for things started directly from an ssh session, which is much of the utility of reptyr :/ If that'd be useful, I'd consider doing a prototype, but I just don't know how to do this in general. |
Would have been a pretty useful feature to have |
If the kernel features currently available aren't sufficient, perhaps this calls for some new kernel features? (Hell, that's what Google did with cgroups, and had they not we wouldn't have systemd or Docker.) |
reptyr master now includes a One known limitation, unfortunately, because of how it works and an interaction with how |
I'm running as root using sudo -i, but get unable to attach to pid 3822: Permission denied |
if you're using Ubuntu, there are rules in place to prevent you from doing that. http://www.bay12forums.com/smf/index.php?topic=65326.0 |
This is really cool. Impressive lateral thinking, Nelson. A couple of initial surprises that I'm not sure I'd consider bugs:
|
|
Sorry, disregard the second point. I was experimenting using mplayer and it turns out this is normal behaviour outside the context of reptyr. E.g. Start mplayer, Ctrl+Z, |
Why was this closed even though it still doesn't work? |
@melikyuksel It should work with |
reptyr -T worked fine for me with a stuck old dpkg process that spawned a whiptail subshell for configuration options from another ssh session. Great work and Thanks! |
You can Your terminal ends up in a weird state where you can type in commands but the process is running "at the same time" in the background, but since it is not a direct child of the shell, you can't do Still, it's useful if you need to move a long-running build process around into a different terminal just to keep it alive, for whatever reason. |
@infinity0 Thanks! That worked wonders. Quick question, if I have to do it for the third time, I'd still be using the PID of first reptyr right? |
@akashaggarwal7 not sure, but you can run |
Completely ignore the |
@JeromeJ I have the exact same problem. I found out I have the 0.5 version also, which is about 4 years old now. Since I am new to Linux all in all, I need to figure out how i can upgrade something that is already in the source depot.. Oh well, at least I'm having fun. |
@Sandoras you're new to Linux but you're running reptyr... You really have chosen to dive in at the deep end :) Some minimal steps to get a runnable version of the github tip if you don't care about Bash completion and do not have root/sudo:
HTH |
@Smattr Thank you! I already installed the 5.0 version of reptyr via apt-get. This will still work? And what directory do you suppose I can put it in? |
Did you mean version 0.5? It doesn't look to me like it's reached 5.0. As far as I'm aware, the two versions should happily co-exist if that's what you're asking. You might want to uninstall the apt-get-provided version to avoid confusion though. With regards to what directory to put it in, Linux isn't particularly picky about where you put things. For example, you could install it to ~/reptyr and then run it as |
I get this when trying the -T Child is not connected to a pseudo-TTY. Unable to steal TTY |
@BarbzYHOOL did you ever find a solution to this? I have a process that I failed to capture and is now a child of systemd that gives that error |
I don't know how far into debugging this you are but if it helps, the symptoms indicate your process is not connected to a Unix 98 PTY. [Aside @nelhage, is it deliberate that |
@Smattr I don't think there was any reason for that, but I also agree I can't imagine it causing problems in practice. |
(I'd happily take a PR to fix if you're feeling motivated) To the original question, |
Yeah I understand |
Still getting the following error when using
Any workaround for this? I'm logged in as root |
What if the initial command was run as another user than I'm currently in that case, and running Thanks EDIT: sorry for the duplicate comment, I first got an error saying that submitting failed, while it actually didn't. |
See:
The text was updated successfully, but these errors were encountered: