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

Systemd unit file template contains impossible to reach option "StartLimitBurst=5" #615

Closed
omeinderink opened this issue May 22, 2020 · 1 comment

Comments

@omeinderink
Copy link

Describe the Bug

The file templates/etc/systemd/system/docker-run.erb contains these three Systemd unit file options:

[Unit]
StartLimitIntervalSec=20
StartLimitBurst=5
[Service]
RestartSec=5

These numbers make no sense: if a service fails Systemd will wait for 5 seconds before restarting it. That amounts to a maximum number of 4 restarts every 20 seconds. StartLimitBurst will prevent the service from being restarted more than 5 times in 20 seconds (per StartLimitIntervalSec=20), which accordingly will never happen.

The result is that a failing service will never stop restarting as it never reaches the limit.

Expected Behavior

A failing service eventually is in "failed" status in Systemd

Steps to Reproduce

Create an intentionally failing service by editing the script created by the module at
/usr/local/bin/docker-run-<%= @sanitised_title %>-start.sh
and adding
exit 1
after the shebang line, then restart the service via Systemd. The service will never stop restarting.

Environment

  • Ubuntu 18.04
@chelnak
Copy link
Contributor

chelnak commented Feb 24, 2022

Closing as it looks like this was fixed in #616 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants