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

sdexec: systemd tries to kill guest tasks without sufficient permission #6399

Closed
garlick opened this issue Oct 30, 2024 · 2 comments · Fixed by #6402
Closed

sdexec: systemd tries to kill guest tasks without sufficient permission #6399

garlick opened this issue Oct 30, 2024 · 2 comments · Fixed by #6402

Comments

@garlick
Copy link
Member

garlick commented Oct 30, 2024

Problem: the systemd user instance running as flux is not privileged to kill guest processes such as the job shell or tasks, yet it tries if the job does not finalize on its own.

The various options are documented in systemd.kill(5).

sdexec uses the default KillMode=control-group where

all remaining processes in the control group of this unit will be killed on unit stop

A better choice might be KillMode=process where

only the main process itself is killed (not recommended!)
Note that it is not recommended to set KillMode= to process or even none, as this allows processes to escape the service manager's lifecycle and resource management, and to remain running even while their service is considered stopped and is assumed to not consume any resources.

We should probably also set SendSIGKILL=no. If the IMP is waiting for processes, SIGKILLing the IMP would lose track of those processes.

@garlick
Copy link
Member Author

garlick commented Oct 31, 2024

Just updated the issue description. sdexec uses KillMode=control-group not mixed as originally stated.

@garlick
Copy link
Member Author

garlick commented Oct 31, 2024

Note that "unit stop" is initiated by sdexec once the main process (IMP) has terminated.

I think the recommendation above of setting KillMode=process SendSIGKILL=no still stands.

See also

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

Successfully merging a pull request may close this issue.

1 participant