Search
in need of help with udev rule
Edit: Go to bottom to read resolution:
am trying to make a stable link to read t-sensor
bash $ sudo nano /etc/udev/rules.d/t_sensor-temp-stable-path.rules
bash ACTION=="add", SUBSYSTEM=="hwmon", KERNEL=="hwmon*", ENV{HWMON_NAME}=="asusec", SYMLINK+="t_sensor_temp", RUN+="/bin/sh -c 'ln -s /sys/class/hwmon/%k/temp2_input /dev/t_sensor_temp'"
bash $ sudo udevadm control --reload-rules $ sudo udevadm trigger
expected result, t-sensor temp2_input file is now linked in /dev/t_sensor_temp
actual result no link in /dev
bash $ cat /dev/t_sensor_temp cat: /dev/t_sensor_temp: No such file or directory
even after rebooting,and running $ sudo udevadm control --reload-rules
$ sudo udevadm trigger
its still failing to create link.
i have stable links in /dev for gpu and cpu which work perfectly
Edit: so i may of resolved the issue and am adding this to maybe help others in the future worth noting i preface "may of" as im not sure if when a hardware change acures that udev will continue to link to hwmon* temp2_input
i first changed the rule
bash ACTION=="add", SUBSYSTEM=="hwmon", ATTRS{name}=="asusec", SYMLINK+="t_sensor_temp", RUN+="/bin/sh -c 'ln -s /sys/class/hwmon/%k/temp2_input /dev/t_sensor_temp'"
kernel is now not present, "ENV{HWMON}" is now "ATTRS{name}" but with these edits the link still was not created.
once i ran the command sudo udevadm trigger --action=add --subsystem-match=hwmon --attr-match=name=asusec
then the symbolic link was created. its been frustrating but glad we got the in the end.
if someone can shine a light on the strange behavior that would be great.