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

Services with RootImage hitting the restart limit lead to failed modprobe@dm_verity.service #23742

Closed
AlbanBedel opened this issue Jun 14, 2022 · 2 comments · Fixed by #23753
Closed
Labels
pid1 please-submit-as-pr portable Anything to do with systemd-portable and portablectl and portables

Comments

@AlbanBedel
Copy link
Contributor

AlbanBedel commented Jun 14, 2022

systemd version the issue has been seen with

247

This version is a bit older but it is on an embedded system where I can't easily switch to a newer version. From my analysis of the related code and unit files I strongly believe this bug is still present in the latest version.

Unexpected behaviour you saw

When a portable service hit the restart limit I also see modprobe@dm_verity.service as failed because it also hit the restart limit.

Steps to reproduce the problem

Make sure dm_verity module is not available, create a service with a RootImage that fails right away, configure it for automatic restart, then launch it.

Looking at the code, units with a RootImage automatically get several modprobe@ added as dependency, which lead to this problem if the respective module doesn't exists. The modprobe@ unit in itself doesn't fail when the module is missing as the command is allowed to fail, but it then hit the restart limit because the parent service keep restarting it.

MR #15027 used to mitigate this problem when the modules can be loaded but it doesn't help when the module can't get loaded. But it was reverted anyways. On the other hand using RemainAfterExit=yes in modprobe@.service as was suggested in #14819 do solve this problem. Removing the restart limit in the modprobe service would be another solution.

@yuwata yuwata added pid1 portable Anything to do with systemd-portable and portablectl and portables labels Jun 15, 2022
@yuwata
Copy link
Member

yuwata commented Jun 15, 2022

Removing the restart limit in the modprobe service would be another solution.

I think this is reasonable. @poettering @bluca WDYT?

@yuwata
Copy link
Member

yuwata commented Jun 15, 2022

Removing the restart limit in the modprobe service would be another solution.

@AlbanBedel Could you provide a PR?

AlbanBedel added a commit to AlbanBedel/systemd that referenced this issue Jun 15, 2022
They are various cases where the same module might be repeatedly
loaded in a short time frame, for example if a service depending on a
module keep restarting, or if many instances of such service get
started at the same time. If this happend the modprobe@.service
instance will be marked as failed because it hit the restart limit.

Overall it doesn't seems to make much sense to have a restart limit on
the modprobe service so just disable it.

Fixes: systemd#23742
keszybz pushed a commit that referenced this issue Jun 21, 2022
They are various cases where the same module might be repeatedly
loaded in a short time frame, for example if a service depending on a
module keep restarting, or if many instances of such service get
started at the same time. If this happend the modprobe@.service
instance will be marked as failed because it hit the restart limit.

Overall it doesn't seems to make much sense to have a restart limit on
the modprobe service so just disable it.

Fixes: #23742
tewarid pushed a commit to tewarid/systemd that referenced this issue Aug 23, 2022
They are various cases where the same module might be repeatedly
loaded in a short time frame, for example if a service depending on a
module keep restarting, or if many instances of such service get
started at the same time. If this happend the modprobe@.service
instance will be marked as failed because it hit the restart limit.

Overall it doesn't seems to make much sense to have a restart limit on
the modprobe service so just disable it.

Fixes: systemd#23742
(cherry picked from commit 9625350)
bluca pushed a commit to bluca/systemd that referenced this issue Jan 27, 2023
They are various cases where the same module might be repeatedly
loaded in a short time frame, for example if a service depending on a
module keep restarting, or if many instances of such service get
started at the same time. If this happend the modprobe@.service
instance will be marked as failed because it hit the restart limit.

Overall it doesn't seems to make much sense to have a restart limit on
the modprobe service so just disable it.

Fixes: systemd#23742
(cherry picked from commit 9625350)
(cherry picked from commit 8539a62)
Werkov pushed a commit to Werkov/systemd that referenced this issue Nov 1, 2023
They are various cases where the same module might be repeatedly
loaded in a short time frame, for example if a service depending on a
module keep restarting, or if many instances of such service get
started at the same time. If this happend the modprobe@.service
instance will be marked as failed because it hit the restart limit.

Overall it doesn't seems to make much sense to have a restart limit on
the modprobe service so just disable it.

Fixes: systemd#23742
(cherry picked from commit 9625350)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pid1 please-submit-as-pr portable Anything to do with systemd-portable and portablectl and portables
Development

Successfully merging a pull request may close this issue.

2 participants