From c26ce825a9bd23498d0b86d0952c65ae0bbd7ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien?= Date: Tue, 23 Jul 2019 17:09:34 +0200 Subject: [PATCH] Systemd service: Restart=always (#36) - add StartLimitIntervalSec and StartLimitBurst to avoid noisy crashloops --- templates/minio.service.j2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/minio.service.j2 b/templates/minio.service.j2 index dfd2b02..33fb255 100644 --- a/templates/minio.service.j2 +++ b/templates/minio.service.j2 @@ -7,6 +7,10 @@ Wants=network-online.target After=network-online.target AssertFileIsExecutable={{ minio_server_bin }} +# Avoid noisy crashloops +StartLimitIntervalSec=60 +StartLimitBurst=5 + [Service] WorkingDirectory=/usr/local/ @@ -20,8 +24,8 @@ ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_ ExecStart={{ minio_server_bin }} server $MINIO_OPTS $MINIO_VOLUMES -# Let systemd restart this service only if it has ended with the clean exit code or signal. -Restart=on-success +# Let systemd always restart this service, in limits defined by StartLimitIntervalSec and StartLimitBurst. +Restart=always StandardOutput=journal StandardError=inherit