-
Notifications
You must be signed in to change notification settings - Fork 545
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
[global] Add the ability to run command as user #3648
Conversation
An initial idea to discuss Once we migrate to python3.9, we can use the Once gotcha I've had so far, if a command is run, to establish some kind of connection, to then run commands afterwards, that doesn't seem to work. So, any thoughts on this would be great, or if someone else has a better way/idea, happy to abandon this PR |
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
My immediate thought was to hold this implementation until the next minor version, but if it requires 3.9 then there's not much use to that, given that we've planned to go to 3.8 instead, with 3.9 coming in early/mid 2025 (per #3533). I haven't yet played around with this, but something that comes to mind is do the The docs mention this sets the current process' id, so I imagine this is not thread-safe? |
based on my testing on the updated PR I have for #3646, I ran through a full sos, and I only saw the commands that it needed to run as the user, actually do it. My understanding was that the Happy to hold off for others to do similar testing, and see how it goes. I've got an update on my system for docstrings, so can incorporate anything else that is required here. |
Oh! I didn't realize that was in |
32fdf8a
to
91673eb
Compare
There is one gotcha with this at the moment especially with the other PR I am working with one of the commands only works with Ultimately for that plugin, I only need to run those as |
So, the issue I have with the current implementation is a corner case because of the way the command for So, this should be good to go, if we can get some reviews. Ideally would like to get this, and once this is merged need to work on the sunbeam to be ready for the next z-release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK.
Maybe it makes sense to log the user somewhere, e.g. in collecting output of
log in https://github.com/sosreport/sos/blob/main/sos/report/plugins/__init__.py#L3082, but it might be too detailed information already..? I dont know.. Leaving on @arif-ali to decide.
This was my thought as well. Code looks good, but I think we should explicitly highlight when we're collecting as non-root, since we run as root. |
91673eb
to
a0caed1
Compare
After reviewing the logs, I found 2 places it was useful to add. Hopefully this fits with what you guys were anticipating |
a0caed1
to
baf41b2
Compare
tried re-running the centos-stream-8 rpm build, maybe an infra issue 🤷🏽 |
We can probably remove the references to CentOS Stream 8 now. Let me open a PR so we can discuss this separately and then if/when it's accepted, we can retry this one. |
Signed-off-by: Arif Ali <[email protected]>
baf41b2
to
1389052
Compare
If the chdir would have been set as well as runas, the chdir would not have taken effect, so updating to reflect the correct behaviour Related: sosreport#3648 Signed-off-by: Arif Ali <[email protected]>
If the chdir would have been set as well as runas, the chdir would not have taken effect, so updating to reflect the correct behaviour Related: #3648 Signed-off-by: Arif Ali <[email protected]>
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines