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

Drop down to root on macOS, just like rbspy #116

Closed
pquentin opened this issue Jun 3, 2019 · 2 comments
Closed

Drop down to root on macOS, just like rbspy #116

pquentin opened this issue Jun 3, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@pquentin
Copy link

pquentin commented Jun 3, 2019

rbspy has this great feature where you can just use sudo on macOS, and rbspy will drop root privileges when executing the script. This should allow to just run "sudo py-spy ..." instead of having to first find the PID, and then run py-spy with sudo.

This is where it seems to be implemented in rbspy: https://github.com/rbspy/rbspy/blob/806ace599aa8e7de99c2134935c0fe1047bc6803/src/main.rs#L164-L179

PS: Thanks for py-spy! It's a great project, and the recent release is even more useful with the removed perl dependency. 💚

@benfred benfred added the enhancement New feature or request label Jun 30, 2019
benfred added a commit that referenced this issue Jul 8, 2019
On OSX we usually have to get sudo access to run py-spy. Rather than pass
root permissions on to the program we are profiling, drop root when
creating the child process.

#116
@benfred
Copy link
Owner

benfred commented Jul 8, 2019

Thanks! I'm glad py-spy is coming in useful for you.

I added some code to drop root permissions in #127 - will be in the next release.

@benfred benfred closed this as completed Jul 8, 2019
@pquentin
Copy link
Author

pquentin commented Jul 8, 2019

Thank you! That works great. This is another awesome improvement. 👏

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

No branches or pull requests

2 participants