@@ -51,11 +51,10 @@ StartLimitBurst=5
5151[Service]
5252Type=exec
5353WorkingDirectory=/opt/gotrue
54- {% if qemu_mode is defined and qemu_mode %}
55- ExecStart=/opt/gotrue/gotrue
56- {% else %}
54+
55+ # Both v2 & v3 need a config-dir for reloading support.
5756ExecStart=/opt/gotrue/gotrue --config-dir /etc/auth.d
58- {% endif %}
57+ ExecReload=/bin/kill -10 $MAINPID
5958
6059User=gotrue
6160Restart=always
@@ -64,10 +63,29 @@ RestartSec=3
6463MemoryAccounting=true
6564MemoryMax=50%
6665
66+ # These are the historical location of env files. The /etc/auth.d dir will
67+ # override them when present.
6768EnvironmentFile=-/etc/gotrue.generated.env
6869EnvironmentFile=/etc/gotrue.env
6970EnvironmentFile=-/etc/gotrue.overrides.env
7071
72+ # Both v2 & v3 support reloading via signals, on linux this is SIGUSR1.
73+ Environment=GOTRUE_RELOADING_SIGNAL_ENABLED=true
74+ Environment=GOTRUE_RELOADING_SIGNAL_NUMBER=10
75+
76+ # Both v2 & v3 disable the poller. While gotrue sets it to off by default we
77+ # defensively set it to false here.
78+ Environment=GOTRUE_RELOADING_POLLER_ENABLED=false
79+
80+ # Determines how much idle time must pass before triggering a reload. This
81+ # ensures only 1 reload operation occurs during a burst of config updates.
82+ Environment=GOTRUE_RELOADING_GRACE_PERIOD_INTERVAL=2s
83+
84+ # v3 does not use filesystem notifications for config reloads.
85+ {% if qemu_mode is defined and qemu_mode %}
86+ Environment=GOTRUE_RELOADING_NOTIFY_ENABLED=false
87+ {% endif %}
88+
7189Slice=services.slice
7290
7391[Install]
0 commit comments