Component
systemd
Is your feature request related to a problem? Please describe
I've recently opened a few issues, and PRs for various projects to address failure conditions that are all related to these services using a systemd *.service file that they've configured by default with Restart=always, but have not included any StartLimitIntervalSec, StartLimitBurst, or RestartSec directives to prevent the service from entering an infinite Start request repeated too quickly loop.
I don't know if there's a commonly understood best-practice for creating service units that handle failures smartly. It just seems that some projects do, while others don't.
The problem in several of the situations I've experienced, and have tried to address, is that when this endless loop happens, it manifests in a way that doesn't leave the user with any obvious understanding as to what exactly is happening, such as just a blank unresponsive screen.
winesapOS/winesapOS#716
ubuntu/lightdm#340
https://gitlab.archlinux.org/archlinux/packaging/packages/openssh/-/issues/3
Only to help illustrate what a user might experience, I asked ChatGPT to talk me through the execution steps of the gdm3 .service unit, in a scenario where xorg.conf contains a value that will cause x11 to immediately fail 100% of the time:
https://chat.openai.com/share/ca3c9786-53f2-476e-8c21-17b4465c4327
Describe the solution you'd like
While I don't think that it is systemd's responsibility that projects use systems units in the most optimal way, I feel like a wandering lunatic roaming from project to project suggesting changes, and having to justify why this was an annoying issue that I've had to work around (such as the case with sshd.service for literally any device running Arch on my network, for whatever reason), and so I wanted to check upstream with the common piece around all this.
At a minimum, perhaps it can be agreed upon that using Restart=always without any supporting directives may possibly result in a negative outcome, as it assumes that restarting the service will magickally fix everything?
If so, maybe a check, and a warning when the user executed daemon-reload?
I don't want to get ahead of myself, and there might be something I'm misunderstanding, so I want to first verify that what I understand is accurate, and that my concern is valid. If so, I hoped to open a conversation about this to see it there is any sort of consensus that can be agreed upon.
Describe alternatives you've considered
Have some reasonable built-in default values for StartLimitIntervalSec, and StartLimitBurst that are used if Restart=always is specified.
Or maybe there ARE default values, and the presence of the repeated too quickly messages means that the service had exceeded those defaults, and systemd permanently put the service in a failed state that requires intervention to restart?
I'm not really clear on the behavior, but logs seem to indicate to me that there are repeated occurrences of repeated too quickly.
The systemd version you checked that didn't have the feature you are asking for
255
Component
systemd
Is your feature request related to a problem? Please describe
I've recently opened a few issues, and PRs for various projects to address failure conditions that are all related to these services using a systemd
*.servicefile that they've configured by default withRestart=always, but have not included anyStartLimitIntervalSec,StartLimitBurst, orRestartSecdirectives to prevent the service from entering an infiniteStart request repeated too quicklyloop.I don't know if there's a commonly understood best-practice for creating service units that handle failures smartly. It just seems that some projects do, while others don't.
The problem in several of the situations I've experienced, and have tried to address, is that when this endless loop happens, it manifests in a way that doesn't leave the user with any obvious understanding as to what exactly is happening, such as just a blank unresponsive screen.
winesapOS/winesapOS#716
ubuntu/lightdm#340
https://gitlab.archlinux.org/archlinux/packaging/packages/openssh/-/issues/3
Only to help illustrate what a user might experience, I asked ChatGPT to talk me through the execution steps of the gdm3 .service unit, in a scenario where xorg.conf contains a value that will cause x11 to immediately fail 100% of the time:
https://chat.openai.com/share/ca3c9786-53f2-476e-8c21-17b4465c4327
Describe the solution you'd like
While I don't think that it is systemd's responsibility that projects use systems units in the most optimal way, I feel like a wandering lunatic roaming from project to project suggesting changes, and having to justify why this was an annoying issue that I've had to work around (such as the case with sshd.service for literally any device running Arch on my network, for whatever reason), and so I wanted to check upstream with the common piece around all this.
At a minimum, perhaps it can be agreed upon that using
Restart=alwayswithout any supporting directives may possibly result in a negative outcome, as it assumes that restarting the service will magickally fix everything?If so, maybe a check, and a warning when the user executed
daemon-reload?I don't want to get ahead of myself, and there might be something I'm misunderstanding, so I want to first verify that what I understand is accurate, and that my concern is valid. If so, I hoped to open a conversation about this to see it there is any sort of consensus that can be agreed upon.
Describe alternatives you've considered
Have some reasonable built-in default values for
StartLimitIntervalSec, andStartLimitBurstthat are used ifRestart=alwaysis specified.Or maybe there ARE default values, and the presence of the
repeated too quicklymessages means that the service had exceeded those defaults, and systemd permanently put the service in a failed state that requires intervention to restart?I'm not really clear on the behavior, but logs seem to indicate to me that there are repeated occurrences of
repeated too quickly.The systemd version you checked that didn't have the feature you are asking for
255