systemd: Restart=on-failure#8408
Conversation
There was a problem hiding this comment.
Code Review
This pull request changes the systemd restart policy for the main sssd service from on-abnormal to on-failure. The detailed description provides excellent justification for this change, highlighting a real-world scenario where an OOM event caused sssd to terminate with an exit code that on-abnormal does not handle, leading to system inaccessibility. Changing to on-failure ensures that sssd will be restarted on any failure, including non-zero exit codes, which significantly improves the service's resilience. This also aligns the main service's behavior with all other sssd sub-services, which already use on-failure. The change is correct, well-reasoned, and a clear improvement for system stability.
|
Duplicate of #8407 that i created a day earlier… |
|
ah lol, 15h ago, this wasn't there when I checked for other issues yesterday. Thank you, @Squiddim, for the same thing! |
|
Thanks for you Pull Request. I'll close it because it duplicates #8407 on which we are already working. |
While my machine was under memory pressure and the OOM killer went around, it killed a bunch of sssd services too. sssd itself restarted them and at some point failed to do so. Then it decided to terminate itself with exit code 1, which is not abnormal so systemd never restarted it. This resulted in me not being able to connect to this machine via ssh anymore, so I needed the IT to get access again. (See sssd log below)
While other sssd services have
Restart=on-failurethe main one usesRestart=on-abnormalwhich in this case resulted in an inaccessible system state for me. I would expect a system to recover from this, which should happen with this change.Also see the man pages about the different systemd service
Restart=settings.This PR is about the systemd service which should restart sssd.
There are other issues about sssd stopping to work which are about sssd itself. So I think they are somewhat related but different. The other issues are about the root causes which do not apply here as my issue was the OOM Killer and Memory Pressure, not sssd being unstable by itself. This should also mitigate the other mentioned issues but won’t solve their underlying cause, so they should stay open.
For the short term workaround this systemd service override was added:
Adding
OOMScoreAdjustto this service is also propagated to the child services being started. If this is also something you would like for the service, I can create another PR with it. Personally I thinkRestart=on-failureis a fix, so different from an addition → separate discussion.Existing restart conditions in this Repo before this PR. Note that this is the only
on-abnormalservice.Log of the situation in the journal (Some things are censored with
###).System reboot at Jan 24, OOM killer going around on Jan 26, sssd manually restarted on Jan 27