Skip to content

Commit 71d72cf

Browse files
AmateurECEgaul
authored andcommitted
Fix PIDFile= reference, restart latency in systemd service
The run directory has been moved from /var/run to /run in systemd, which results in the following warning at boot: ``` /usr/lib/systemd/system/mbpfan.service:10: PIDFile= references a path below legacy directory /var/run/, updating /var/run/mbpfan.pid → /run/mbpfan.pid; please update the unit file accordingly. ``` Additionally, the service occasionally fails to start if the service is started before coretemp devices have finished probing, which results in the following error. This patch fixes this issue. ``` systemd[1]: Started A fan manager daemon for MacBook Pro. mbpfan[350]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting. systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: mbpfan.service: Failed with result 'exit-code'. systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 1. systemd[1]: Stopped A fan manager daemon for MacBook Pro. systemd[1]: Started A fan manager daemon for MacBook Pro. mbpfan[369]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting. systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: mbpfan.service: Failed with result 'exit-code'. systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 2. systemd[1]: Stopped A fan manager daemon for MacBook Pro. mbpfan[380]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting. systemd[1]: Started A fan manager daemon for MacBook Pro. systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: mbpfan.service: Failed with result 'exit-code'. systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 3. mbpfan[393]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting. systemd[1]: Stopped A fan manager daemon for MacBook Pro. systemd[1]: Started A fan manager daemon for MacBook Pro. systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: mbpfan.service: Failed with result 'exit-code'. systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 4. systemd[1]: Stopped A fan manager daemon for MacBook Pro. systemd[1]: Started A fan manager daemon for MacBook Pro. mbpfan[416]: /usr/sbin/mbpfan needs coretemp support. Please either load it or build it into the kernel. Exiting. systemd[1]: mbpfan.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: mbpfan.service: Failed with result 'exit-code'. systemd[1]: mbpfan.service: Scheduled restart job, restart counter is at 5. systemd[1]: Stopped A fan manager daemon for MacBook Pro. systemd[1]: mbpfan.service: Start request repeated too quickly. systemd[1]: mbpfan.service: Failed with result 'exit-code'. systemd[1]: Failed to start A fan manager daemon for MacBook Pro. ```
1 parent 95b6ba9 commit 71d72cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mbpfan.service

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ After=sysinit.target
77
Type=simple
88
ExecStart=/usr/sbin/mbpfan -f
99
ExecReload=/usr/bin/kill -HUP $MAINPID
10-
PIDFile=/var/run/mbpfan.pid
10+
PIDFile=/run/mbpfan.pid
1111
Restart=always
12+
RestartSec=1
1213

1314
[Install]
1415
WantedBy=sysinit.target

0 commit comments

Comments
 (0)