Bug 727698

Summary: udev startup error
Product: Red Hat Enterprise Linux 6 Reporter: Levente Farkas <lfarkas>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED WORKSFORME QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-01 09:44:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Levente Farkas 2011-08-02 22:31:10 UTC
we've got a special usb device, and when we plug/unplug we write our own rules which is working properly except one thing. during the boot this lines in udev:

ACTION=="remove", DEVLINKS=="/dev/foo_ups", RUN+="/usr/libexec/foo/liebert-udev"

we always got this during boot:

Starting udev: udevd[476]: unknown key 'DEVLINKS' in /etc/udev/rules.d/10-foo.rules:11

since there is no other way during remove a usb-serial adapter then DEVLINKS we can't find other ways to write the rules. and anyway why it's a problem if it's work properly after boot.

Comment 2 Harald Hoyer 2011-08-03 10:35:45 UTC
try:

ACTION=="remove", SYMLINKS=="foo_ups",
RUN+="/usr/libexec/foo/liebert-udev"

Comment 3 Harald Hoyer 2011-08-03 10:36:05 UTC
sorry:

ACTION=="remove", SYMLINK=="foo_ups",
RUN+="/usr/libexec/foo/liebert-udev"

Comment 4 Levente Farkas 2011-08-03 10:58:33 UTC
it's not working while the original was working:-(
anyway it's a simple serial to usb converter so you can also try. the add line was:
ACTION=="add", KERNEL=="ttyUSB[0-9]", SYSFS{idVendor}=="058f", SYSFS{idProduct}=="9720", SYMLINK+="foo_ups", RUN+="/usr/libexec/foo/liebert-udev"

the problem is that udev don't give back the SYSFS and SYMLINK parameter in case of remove.

Comment 5 Harald Hoyer 2011-08-03 12:22:09 UTC
(In reply to comment #4)
> it's not working while the original was working:-(
> anyway it's a simple serial to usb converter so you can also try. the add line
> was:
> ACTION=="add", KERNEL=="ttyUSB[0-9]", SYSFS{idVendor}=="058f",
> SYSFS{idProduct}=="9720", SYMLINK+="foo_ups",
> RUN+="/usr/libexec/foo/liebert-udev"
> 
> the problem is that udev don't give back the SYSFS and SYMLINK parameter in
> case of remove.

Yes, because the SYMLINK is removed, there is no more sysfs entry anymore, because the device already disappeared.

Comment 6 Harald Hoyer 2011-08-03 12:30:05 UTC
try the ENV{REMOVE_CMD}:


ACTION=="add", KERNEL=="ttyUSB[0-9]", SYSFS{idVendor}=="058f",
 SYSFS{idProduct}=="9720", SYMLINK+="foo_ups",
 RUN+="/usr/libexec/foo/liebert-udev",
 ENV{REMOVE_CMD}="/usr/libexec/foo/liebert-udev"

Comment 7 Levente Farkas 2011-08-03 13:03:32 UTC
it's still not working:-(

anyway the original problem was that the system gives an error during boot.
and the original rule is working:-)

but if you've any other tip we can try it...

Comment 8 Levente Farkas 2011-08-03 13:20:42 UTC
ok the exact situatuion is that your solution working on rhel-6, but not on rhel-5, but we find the solution:
http://comments.gmane.org/gmane.linux.hotplug.devel/14254

after we add this line:
ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
it's working on both rhel-6 and rhel-5:-)