Skip to content

Commit b741ca9

Browse files
author
Chris Stockton
committed
fix: set restart limits to 0 to prevent being marked as failed
The systemd default is 10s / 5 for these values with a DefaultRestartUSec of 100ms. Most services set a RestartSec limit of 3, under most circumstances it takes 15s to restart 5 times so the limit of 10s is not exceeded. However if other system processes (salt, cloud init) restart it explicitly, or recovering system services within the --before chain trigger a restart the limit can be exceeded causing it to be marked as failed. Since no services mark gotrue.service as required it will remain offline until the next explicit restart is issued. Setting these values to 0 with Restart=always and RestartSec=3 will prevent gotrue from being marked as failed.
1 parent 75c8517 commit b741ca9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

ansible/files/gotrue.service.j2

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,19 @@ After=network-online.target systemd-resolved.service
4040
Wants=postgresql.service
4141
After=postgresql.service
4242

43-
# Lower start limit ival and burst to prevent the noisy flapping
44-
StartLimitIntervalSec=10
45-
StartLimitBurst=5
43+
# The systemd default is 10s / 5 for these values with a DefaultRestartUSec of
44+
# 100ms. Most services set a RestartSec limit of 3, under most circumstances it
45+
# takes 15s to restart 5 times so the limit of 10s is not exceeded. However if
46+
# other system processes (salt, cloud init) restart it explicitly, or recovering
47+
# system services within the --before chain trigger a restart the limit can be
48+
# exceeded causing it to be marked as failed. Since no services mark
49+
# gotrue.service as required it will remain offline until the next explicit
50+
# restart is issued.
51+
#
52+
# Setting these values to 0 with Restart=always and RestartSec=3 will prevent
53+
# gotrue from being marked as failed.
54+
StartLimitIntervalSec=0
55+
StartLimitBurst=0
4656

4757
[Service]
4858
Type=exec

0 commit comments

Comments
 (0)