-
Notifications
You must be signed in to change notification settings - Fork 7
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
allow privileged IMP to linger during flux-imp run
to support signal forwarding
#188
Conversation
e1204b7
to
0ccc432
Compare
Problem: Unlike `exec`, `flux-imp run` doesn't linger and instead directly executes the target command. This then requires the use of `flux-imp kill` to kill the privlieged process(es) that are a result. Have the IMP fork() and exec() the run command. The lingering IMP process can then forward signals delivered to it, including the use of SIGUSR1 as a surrogate for SIGKILL.
0ccc432
to
c5323d1
Compare
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.
Well jeez, this looks straightforward also! I'll approve assuming your testing pans out!
Actually there's a couple issues still remaining here:
|
Problem: The IMP run implementation sets the real user and group id of the process to the effective user and group id in the privileged parent, but this makes it so that the invoking user can no longer deliver signals to the IMP parent process. Move the setuid()/setgid() calls to the child process just before execve(2) is called. The parent IMP thereby maintains the real uid/gid of the invoking user and can handle forwarding of signals from that user to the invoked run command. Since the parent IMP process no longer has a real userid of 0/root, update the call that obtains the userid for setting USER and HOME to use the effective uid.
Problem: There is no test that ensures the privileged IMP lingers to handle signal delivery with `flux-imp run`. Add a test to t2002-imp-run.t.
c5323d1
to
309b1c3
Compare
I had forgotten that I also figured out some issues with the test and that appears to now be working as well. This could definitely use some more real world testing. |
flux-imp run
to support signal forwardingflux-imp run
to support signal forwarding
Removed WIP. This seems to be working as designed now, and is much more robust than the |
Excellent! Will try to get that done tomorrow morning. |
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.
I tried some basic sanity testing on my cluster, sending SIGTERM and SIGKILL to housekeeping with this, and everything worked! LGTM!
Thanks! I've set mwp |
This PR changes the
flux-imp run
implementation to have the privileged IMP linger and delegate signals to its child, which the calling user would not otherwise have privilege to do.WIP while I test this out locally.