mcgillij / amdfan

Updated AMD Fan control utility forked from amdgpu-fan and updated.
https://mcgillij.dev/pages/amdfan.html
GNU General Public License v2.0
33 stars 7 forks source link

The service cant find amdfan - Debian 11 #14

Closed MatiasPujado closed 2 years ago

MatiasPujado commented 2 years ago

Big Thanks

Hi! Thank you so much for keeping the project alive, I found it really useful specially combined with conky.

The Issue

I'm facing a weird situation. I'll explain: I've installed amdfan using this command: sudo pip3 install amdfan. Then I started setting it up exactly how is detailed in the Readme file and by the time I was done I got this error when I ran sudo systemctl status amdfan:

● amdfan.service - amdfan controller
     Loaded: loaded (/etc/systemd/system/amdfan.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-02-15 21:43:52 -03; 24min ago
    Process: 179413 ExecStart=/usr/bin/amdfan --daemon (code=exited, status=203/EXEC)
   Main PID: 179413 (code=exited, status=203/EXEC)
        CPU: 649us

So I went to check on both of the files I created. Here is what I have: cat /etc/amdfan.yml

#Fan Control Matrix.
# [<Temp in C>,<Fanspeed in %>]
speed_matrix:
- [4, 4]
- [30, 33]
- [45, 50]
- [60, 66]
- [65, 69]
- [70, 75]
- [75, 89]
- [80, 100]

# Current Min supported value is 4 due to driver bug
#
# Optional configuration options
#
# Allows for some leeway +/- temp, as to not constantly change fan speed
# threshold: 4
#
# Frequency will change how often we probe for the temp
# frequency: 5
#
# While frequency and threshold are optional, I highly recommend finding
# settings that work for you. I've included the defaults I use above.
#
# cards:
# can be any card returned from `ls /sys/class/drm | grep "^card[[:digit:]]$"`
# - card0

and cat /usr/lib/systemd/system/amdfan.service

[Unit]
Description=amdfan controller

[Service]
ExecStart=/usr/bin/amdfan --daemon
Restart=always

[Install]
WantedBy=multi-user.target

and that's when I took a closer look with sudo journalctl -u amdfan:

Feb 15 21:05:01 Dark-Knight systemd[1192373]: amdfan.service: Failed to locate executable /usr/bin/amdfan: No such file or directory
Feb 15 21:05:01 Dark-Knight systemd[1192373]: amdfan.service: Failed at step EXEC spawning /usr/bin/amdfan: No such file or directory
Feb 15 21:05:01 Dark-Knight systemd[1]: amdfan.service: Main process exited, code=exited, status=203/EXEC
Feb 15 21:05:01 Dark-Knight systemd[1]: amdfan.service: Failed with result 'exit-code'.
Feb 15 21:05:01 Dark-Knight systemd[1]: amdfan.service: Scheduled restart job, restart counter is at 4.
Feb 15 21:05:01 Dark-Knight systemd[1]: Stopped amdfan controller.
Feb 15 21:05:01 Dark-Knight systemd[1]: Started amdfan controller.
Feb 15 21:05:01 Dark-Knight systemd[1192374]: amdfan.service: Failed to locate executable /usr/bin/amdfan: No such file or directory
Feb 15 21:05:01 Dark-Knight systemd[1192374]: amdfan.service: Failed at step EXEC spawning /usr/bin/amdfan: No such file or directory
Feb 15 21:05:01 Dark-Knight systemd[1]: amdfan.service: Main process exited, code=exited, status=203/EXEC
Feb 15 21:05:01 Dark-Knight systemd[1]: amdfan.service: Failed with result 'exit-code'.
Feb 15 21:05:01 Dark-Knight systemd[1]: amdfan.service: Scheduled restart job, restart counter is at 5.
Feb 15 21:05:01 Dark-Knight systemd[1]: Stopped amdfan controller.
Feb 15 21:05:01 Dark-Knight systemd[1]: amdfan.service: Start request repeated too quickly.
Feb 15 21:05:01 Dark-Knight systemd[1]: amdfan.service: Failed with result 'exit-code'.
Feb 15 21:05:01 Dark-Knight systemd[1]: Failed to start amdfan controller.
Feb 15 21:09:26 Dark-Knight systemd[1]: Started amdfan controller.
Feb 15 21:09:26 Dark-Knight systemd[1219622]: amdfan.service: Failed to locate executable /usr/bin/amdfan: No such file or directory
Feb 15 21:09:26 Dark-Knight systemd[1219622]: amdfan.service: Failed at step EXEC spawning /usr/bin/amdfan: No such file or directory
Feb 15 21:09:26 Dark-Knight systemd[1]: amdfan.service: Main process exited, code=exited, status=203/EXEC
Feb 15 21:09:26 Dark-Knight systemd[1]: amdfan.service: Failed with result 'exit-code'.
Feb 15 21:09:26 Dark-Knight systemd[1]: amdfan.service: Scheduled restart job, restart counter is at 1.
Feb 15 21:09:26 Dark-Knight systemd[1]: Stopped amdfan controller.
Feb 15 21:09:26 Dark-Knight systemd[1]: Started amdfan controller.
Feb 15 21:09:26 Dark-Knight systemd[1219631]: amdfan.service: Failed to locate executable /usr/bin/amdfan: No such file or directory
Feb 15 21:09:26 Dark-Knight systemd[1219631]: amdfan.service: Failed at step EXEC spawning /usr/bin/amdfan: No such file or directory
Feb 15 21:09:26 Dark-Knight systemd[1]: amdfan.service: Main process exited, code=exited, status=203/EXEC
Feb 15 21:09:26 Dark-Knight systemd[1]: amdfan.service: Failed with result 'exit-code'.
Feb 15 21:09:26 Dark-Knight systemd[1]: amdfan.service: Scheduled restart job, restart counter is at 2.
Feb 15 21:09:26 Dark-Knight systemd[1]: Stopped amdfan controller.
Feb 15 21:09:26 Dark-Knight systemd[1]: Started amdfan controller.

So it seems that the service can not find the binary. I checked and it is not there: ls -alh /usr/bin | grep amdfan And I cant find it, but! look at this output: amdfan --monitor

AMD Fan Control - ctrl-c to quit
                 amdgpu                 
┏━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Card  ┃ fan_speed (RPM) ┃ gpu_temp ℃ ┃
┡━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ card0 │ 1461            │ 37.0       │
└───────┴─────────────────┴────────────┘

Aborted!

So... is it running?It is clear that the OS was able to identify it and allow me to run it manually, my guess is that was installed in another directory. I'll update if I find anything new. I'd appreciate if anyone could point me in the right direction. Its an amazing software and I would love to get it running properly. Thank you in advance

mcgillij commented 2 years ago

which amdfan should tell you where the binary is that you were able to call as your user, then you can probably use that.

mcgillij commented 2 years ago

The /usr/bin link is only created when installing from the AUR in arch linux.

MatiasPujado commented 2 years ago

Thank you Jason! I copied the binary to the /usr/bin directory and it got fixed!