2012-07-04 23:12:17 +00:00
|
|
|
[Unit]
|
2014-06-29 15:26:30 +00:00
|
|
|
Description=A fan manager daemon for MacBook Pro
|
2012-07-04 23:12:17 +00:00
|
|
|
After=syslog.target
|
2014-06-29 15:26:30 +00:00
|
|
|
After=sysinit.target
|
2012-07-04 23:12:17 +00:00
|
|
|
|
|
|
|
[Service]
|
2014-06-29 15:26:30 +00:00
|
|
|
Type=simple
|
2017-08-14 13:08:29 +00:00
|
|
|
ExecStart=/usr/sbin/mbpfan -f
|
2014-06-29 15:26:30 +00:00
|
|
|
ExecReload=/usr/bin/kill -HUP $MAINPID
|
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.
```
2022-07-23 04:39:23 +00:00
|
|
|
PIDFile=/run/mbpfan.pid
|
2012-07-04 23:12:17 +00:00
|
|
|
Restart=always
|
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.
```
2022-07-23 04:39:23 +00:00
|
|
|
RestartSec=1
|
2012-07-04 23:12:17 +00:00
|
|
|
|
|
|
|
[Install]
|
2014-06-29 15:26:30 +00:00
|
|
|
WantedBy=sysinit.target
|