From 8227461531d66a9632ffd5762ef2af89a41e68ad Mon Sep 17 00:00:00 2001 From: Joost van Amersfoort Date: Sun, 3 May 2020 14:01:04 +0100 Subject: [PATCH 1/2] Fix not being able to start because driver unavailable sometimes it takes a while for the temperature of the gpu to become available, leading to ``` FILE_TEMP=$(echo /sys/class/drm/card0/device/hwmon/hwmon?/temp1_input) ``` being empty and the service failing with "invalid hwmon files". I tried to look for a valid service to start after, but it doesn't seem to exist. Alternative to this solution there's a few others: - Restart (with 5 sec delays) until service starts successfully. - Add a path watcher for `/sys/class/drm/card0/device/hwmon/hwmon?/temp1_input` The first could lead to an infinite restart loop, the second muddles logic from the `amdgpu_control` script and the service. --- amdgpu-fancontrol.service | 1 + 1 file changed, 1 insertion(+) diff --git a/amdgpu-fancontrol.service b/amdgpu-fancontrol.service index eca6a32..856fe7c 100644 --- a/amdgpu-fancontrol.service +++ b/amdgpu-fancontrol.service @@ -3,6 +3,7 @@ Description=amdgpu-fancontrol [Service] Type=simple +ExecStartPre=/bin/sleep 5 ExecStart=/usr/bin/amdgpu-fancontrol [Install] From 2aa6e98beab1e47987148d651e6a845ec19eff7e Mon Sep 17 00:00:00 2001 From: Joost van Amersfoort Date: Sun, 7 Jun 2020 19:31:01 +0100 Subject: [PATCH 2/2] Change to restart on failure --- amdgpu-fancontrol.service | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/amdgpu-fancontrol.service b/amdgpu-fancontrol.service index 856fe7c..03ed0e5 100644 --- a/amdgpu-fancontrol.service +++ b/amdgpu-fancontrol.service @@ -2,9 +2,9 @@ Description=amdgpu-fancontrol [Service] -Type=simple -ExecStartPre=/bin/sleep 5 ExecStart=/usr/bin/amdgpu-fancontrol +Restart=on-failure +RestartSec=5 [Install] -WantedBy=multi-user.target +WantedBy=default.target