daringer/asus-fan

asus-fan-create-symlinks.sh creates broken temp links on ASUS UX303LN on Ubuntu 14.04.3 LTS

Closed this issue · 4 comments

Hi!

I noticed lately that my fan is cycling on later than it use to and that things seem to be heating up until CPU throttling kicks in. I checked my thermald config and then started looking at the temp links that are created to the sensor only to find that three of the links are broken:
screenshot from 2016-01-04 09 05 03

I found that these sensors are inside the /sys/devices/platform/coretemp.0 directory.

Changing the links so that they point to the temp sensors and restarting thermald fixes this problem. Am I the only one seeing this broken links? Running:
ls -lA /tmp/asus-fan-shm/
will show you if you have broken links in a color terminal. Otherwise you will need to do a cat of the temperature sensors. If you get a number for the temperature they are good if you get "No such file or directory" you have the same issue.

Frederick

Information about the Linux distro and kernel I am running
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty

$ uname -r
3.13.0-74-generic

$ uname -a
Linux frederick 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Hi @daringer !
I see that you closed this issue, however it does not appear to be fixed.
In going back over the #41 pull request I realized that this issue was still not fixed and that I was using a modified version of asus-fan-create-symlinks.sh.

I would like to fix this correctly for Ubuntu version 14.04, however I plan to move to 16.04 in the coming months so I will at that time work on a version for that release too. Ubuntu 14.04 is still using the sysv and upstart init systems. Ubuntu 16.04 uses systemd.

Currently in 14.04 I have added a few lines to /etc/init.d/thermald to "just make it work". My idea would be have the Ubuntu DKMS installation script add a few lines to the sysv startup script /etc/init.d/rc.local to run asus-fan-create-symlinks.sh to create the needed symlinks.

Do you think it would be better for me to make a separate script (asus-fan-ubuntu-create-symlinks.sh ?) for Ubuntu or to add logic to determine the Linux distro and version so that we could then use the logic to create the proper symlinks in the current asus-fan-create-symlinks.sh?

You are using Arch and the links are being created with lines like:
ln -s /sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input ${d}/die_temp

I am currently using lines like this for Ubuntu 14.04:
ln -s /sys/devices/platform/coretemp.0*/temp1_input ${d}/die_temp

However it digging around I found that I could also use:
ln -s /sys/devices/platform/coretemp.0/hwmon/hwmon*/*/temp1_input ${d}/die_temp
or
ln -s /sys/devices/platform/coretemp.0/hwmon/hwmon?/*/temp1_input ${d}/die_temp
as my temp1_input is also located at:
/sys/devices/platform/coretemp.0/hwmon/hwmon1/device/temp1_input

At what path is your temp1_input located at on Arch Linux?
Do you know a wildcard that would find both of them?

Thanks in advance for your input!
Frederick

I just found that I also added lines to the /etc/init/thermald upstart script to run the script to create the symlinks after boot. I am now not sure that a /etc/init.d/rc.local solution will work. I think that I will instead add documentation on how to setup the start up scripts.

The question then is still how to deal will the links needing to point to different places on different distros (and possibly versions).

Hi @daringer !

It looks like the systemd file might work for Ubuntu after 14.04 when Ubuntu starts to use Systemd instead of Upstart. I think it would be best to try and use the same scripts as much as possible between linux distros.

With this is mind I modified the symlink creation script to detect the Linux Distro. At this point it only creates a few links differently if it detects that Ubuntu is the Linux running. I would be happy if you could test the asus-fan-create-symlinks.sh script on Arch and other Linux distribution if you have access to them and see that it works correctly there too.

With commit frederickjh/asus-fan@6fd7785 I have finished the work that I would like to do before asking you to consider the pull request for inclusion.

Thanks!
Frederick