Hide Forgot
Description of problem: On the event from ethernet device driver udev daemon is unable to execute udev rules. system logs show following messages. Oct 18 17:25:22 dut3145 systemd-udevd: unknown key 'SYSFS{device}' in /etc/udev/rules.d/99-qlcnic.rules:1 Oct 18 17:25:22 dut3145 systemd-udevd: invalid rule '/etc/udev/rules.d/99-qlcnic.rules:1' Version-Release number of selected component (if applicable): [root@dut3145 ~]# uname -r 3.10.0-28.el7.x86_64 [root@dut3145 ~]# uname -a Linux dut3145 3.10.0-28.el7.x86_64 #1 SMP Mon Sep 23 17:57:58 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux How reproducible: Always Steps to Reproduce: 1.Generate udev event from driver 2.udev rules will get invoked 3.udev rules fails to execute Actual results: Oct 18 17:25:22 dut3145 systemd-udevd: unknown key 'SYSFS{device}' in /etc/udev/rules.d/99-qlcnic.rules:1 Oct 18 17:25:22 dut3145 systemd-udevd: invalid rule '/etc/udev/rules.d/99-qlcnic.rules:1' Expected results: I am thinking it should pass Additional info: cat 99-qlcnic.rules SUBSYSTEM=="pci", SYSFS{device}=="0x8020", ACTION=="change", RUN+="qlcnic_udev.sh" SUBSYSTEM=="pci", SYSFS{device}=="0x8030", ACTION=="change", RUN+="qlcnic_udev.sh" SUBSYSTEM=="pci", SYSFS{device}=="0x8040", ACTION=="change", RUN+="qlcnic_udev.sh" is there any change in udev rules? were SYSFS key pair rules removed in this kernel? when I use ATTRS key value instead of SYSFS it works fine but with this error (invalid key/value pair in file /etc/udev/rules.d/99-qlcnic.rules on line starting at character('\n')). But invocation of "qlcnic_udev.sh" works fine which runs when udev rules gets executed. Note: SYSFS key value pair is working on redhat 6.X OS. Also, On invocation of udev rules(when using ATTRS) "qlcnic_udev.sh" which is user space script is failing for ethtool operations due to SELINUX enforcement. I am trying to create a file on file system in qlcnic_udev.sh script using this command ethtool -w ethX data /opt/xyz.bin which is not creating any file in /opt directory. is this expected or a BUG? Please let me know if you need additional informations Thanks Manish
(In reply to manish from comment #0) > cat 99-qlcnic.rules > SUBSYSTEM=="pci", SYSFS{device}=="0x8020", ACTION=="change", > RUN+="qlcnic_udev.sh" > SUBSYSTEM=="pci", SYSFS{device}=="0x8030", ACTION=="change", > RUN+="qlcnic_udev.sh" > SUBSYSTEM=="pci", SYSFS{device}=="0x8040", ACTION=="change", > RUN+="qlcnic_udev.sh" These rules should look like this: SUBSYSTEM=="pci", ATTRS{device}=="0x8040", ACTION=="change", RUN+="/path/to/qlcnic_udev.sh" 1. SYSFS is long deprecated and has been removed with udev-173 it should be replaced by ATTR or ATTRS to match any parent device. 2. RUN only executed commands, which have a full path specified (there is no PATH) 3. If you are using ATTRS, you might want to add additional filters, as it can then RUN for several sub events of a device
Hi Harald, As you said "If you are using ATTRS, you might want to add additional filters, as it can then RUN for several sub events of a device" Can you please tell us what additional filters can we add? Here is the mechanism this "qlcnic_udev.sh" script gets invoked on udev event. An ethernet device driver sends an event using kernel callback kobject_uevent_env(). This event causes to run this script on this event. We only want that this script gets invoked by this event from ethernet driver only. Can you please help us how can we make it only to invoke on behalf of the event generated from the ethernet device driver? We don't want to invoke this on behalf of several sub events of a device. Thanks
(In reply to QLogic Linux NIC Driver from comment #3) > Hi Harald, > > As you said > "If you are using ATTRS, you might want to add additional filters, as it can > then RUN for several sub events of a device" > > Can you please tell us what additional filters can we add? > Here is the mechanism this "qlcnic_udev.sh" script gets invoked on udev > event. > > An ethernet device driver sends an event using kernel callback > kobject_uevent_env(). This event causes to run this script on this event. We > only want that this script gets invoked by this event from ethernet driver > only. > > Can you please help us how can we make it only to invoke on behalf of the > event generated from the ethernet device driver? We don't want to invoke > this on behalf of several sub events of a device. > > > Thanks use ATTR instead of ATTRS then.