From 2220c56aac03bd6a2105af6fb55bd6ca06cc59e1 Mon Sep 17 00:00:00 2001 From: Domen Tabernik Date: Tue, 28 Jul 2020 14:36:58 +0200 Subject: [PATCH] Added automatic restart to systemd service --- .../system/superfans-gpu-controller.service.template | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/etc/systemd/system/superfans-gpu-controller.service.template b/etc/systemd/system/superfans-gpu-controller.service.template index 4d19c08..2136b69 100644 --- a/etc/systemd/system/superfans-gpu-controller.service.template +++ b/etc/systemd/system/superfans-gpu-controller.service.template @@ -2,14 +2,23 @@ Description=GPU-based controller of SUPERMICRO server FANs After=syslog.target nvidia-persistenced.service +StartLimitIntervalSec=500 +StartLimitBurst=5 + [Service] Type=simple + User=root Group=root + Environment="PYTHONUNBUFFERED=true" ExecStart=/placeholder/path/to/superfans-gpu-controller "/etc/superfans-gpu-controller.json" + StandardOutput=syslog StandardError=syslog +Restart=on-failure +RestartSec=5s + [Install] WantedBy=multi-user.target