Skip to content
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

Works in any Linux terminal? #62

Open
trusktr opened this issue Sep 8, 2015 · 5 comments
Open

Works in any Linux terminal? #62

trusktr opened this issue Sep 8, 2015 · 5 comments

Comments

@trusktr
Copy link

trusktr commented Sep 8, 2015

Or does it have to be used in screen?

I get this when trying:

>>> reptyr 8274
Unable to attach to pid 8274: Operation not permitted
The kernel denied permission while attaching. If your uid matches
the target's, check the value of /proc/sys/kernel/yama/ptrace_scope.
For more information, see /etc/sysctl.d/10-ptrace.conf

>>> sudo reptyr 8274
[sudo] password for root:
[-] Unable to open the tty in the child.
Unable to attach to pid 8274: Permission denied
@trusktr trusktr changed the title Works in any terminal? Works in any Linux terminal? Sep 8, 2015
@nelhage
Copy link
Owner

nelhage commented Sep 8, 2015

Hm, I think that it won't work currently if run on a non-root process as root, although I might be able to fix that.

Does sudo reptyr -T $pid work? That will engage a different mode of attaching, which is designed to work if run as root, among other things.

@trusktr
Copy link
Author

trusktr commented Sep 8, 2015

sudo reptyr -T $pid didn't work. It seems to freeze the terminal where the job I want to transfer is located, and on the destination terminal where I ran sudo reptyr -T $pid the process just hangs, but I can ctrl+c out of it.

@1j
Copy link

1j commented Nov 10, 2016

I also had this same issue on Ubuntu 14.04, but it was solved by following the suggestion in the README:

echo 0 > /proc/sys/kernel/yama/ptrace_scope

and then executing reptyr as non-root (using the same user that initiated the process).

@xrage
Copy link

xrage commented Aug 8, 2017

Faced this issue in ubuntu 16.04 but sudo reptyr -T $pid worked.

@heyakyra
Copy link

heyakyra commented May 1, 2020

It seems to freeze the terminal where the job I want to transfer is located, and on the destination terminal where I ran sudo reptyr -T $pid the process just hangs, but I can ctrl+c out of it.

Did you run fg to bring it to the foreground?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@nelhage @trusktr @heyakyra @1j @xrage and others