my udev rules do not work at all

Bug #178065 reported by SMut
6
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Something is strange in Ubuntu - I am using actually Gutsy.

What should work is this in /etc/udev/rules.d/13-DBbackup.rules:

KERNEL=="sd?1",SUBSYSTEM=="block",ATTR{size}=="16121824",NAME="usbDBbackup",SYMLINK="usbDBbackup",RUN+="/usr/local/bin/usbBackup"

Goal is to use this udev.rule to give an usbstick a special name, mountpoint and run a script to backup a SQLiteDB automagic ;-)
So far, so bad:
First Ubuntu mounts the stick to /dev/stick - it just ignores my rules.

So I removed the automount at the Gnome-Desktop via System/System-/Removable-Devices (or something similar, I run Ubuntu with a German localization)
When I insert the stick now, the rule is still ignored, no name is given, no symlink is set nor the script is run.

Actually SYSFS rules seem to be dead at all, so I used the things given by udevinfo for the device after plugging, dmesg shows me:
[35317.105398] sd 24:0:0:0: [sdb] Attached SCSI removable disk
okay, so I ask the ape:
udevinfo --attribute-walk --name=/dev/sdb1

 looking at device '/block/sdb/sdb1':
    KERNEL=="sdb1"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{stat}==" 24 192 0 0"
    ATTR{size}=="16121824"
    ATTR{start}=="32"
    ATTR{dev}=="8:17"

  looking at parent device '/block/sdb':
    KERNELS=="sdb"
    SUBSYSTEMS=="block"
    DRIVERS==""
    ATTRS{capability}=="13"
    ATTRS{stat}==" 34 23 456 312 0 0 0 0 0 308 312"
    ATTRS{size}=="16121856"
    ATTRS{removable}=="1"
    ATTRS{range}=="16"
    ATTRS{dev}=="8:16"

Great, Where does the SYSFS has gone to? Nevermind, the device and it's parent should be sufficent to create matching rules.
What's wrong with my rule?
Any help highly appreciated, I'm absolutely stuck, sitting 18 hours in front of my computer trying...

Revision history for this message
tsh (tsh) wrote :
Download full text (5.6 KiB)

Confirming a similar problem.

udevinfo -a -p /sys/class/input/input7

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:0b.1/usb2/2-1/input/input7':
    KERNEL=="input7"
    SUBSYSTEM=="input"
    DRIVER==""
    ATTR{name}=="IR-receiver inside an USB DVB receiver"
    ATTR{phys}=="usb-0000:00:0b.1-1/ir0"
    ATTR{uniq}==""

I created
 65-persistent-hauppauge.rules
KERNEL=="input*", ATTRS{name}=="IR-receiver inside an USB DVB receiver", SYMLINK+="input/dvb-ir"

but there is no effect, and the rule is not triggered when testing with udevtest.
udevtest /class/input/event7
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/etc/udev/rules.d/05-options.rules' as rules file
parse_file: reading '/etc/udev/rules.d/05-udev-early.rules' as rules file
parse_file: reading '/etc/udev/rules.d/10-sean.rules' as rules file
parse_file: reading '/etc/udev/rules.d/20-names.rules' as rules file
parse_file: reading '/etc/udev/rules.d/30-cdrom_id.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-basic-permissions.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-permissions.rules' as rules file
parse_file: reading '/etc/udev/rules.d/41-mythtv-permissions.rules' as rules file
parse_file: reading '/etc/udev/rules.d/45-fuse.rules' as rules file
parse_file: reading '/etc/udev/rules.d/45-hplip.rules' as rules file
parse_file: reading '/etc/udev/rules.d/45-libmtp7.rules' as rules file
parse_file: reading '/etc/udev/rules.d/50-boinc-client.rules' as rules file
parse_file: reading '/etc/udev/rules.d/50-libpisock9.rules' as rules file
parse_file: reading '/etc/udev/rules.d/50-xserver-xorg-input-wacom.rules' as rules file
parse_file: reading '/etc/udev/rules.d/55-hpmud.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-symlinks.rules' as rules file
parse_file: reading '/etc/udev/rules.d/61-persistent-storage-edd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/65-dmsetup.rules' as rules file
parse_file: reading '/etc/udev/rules.d/65-persistent-hauppauge.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-cd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-net.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-cd-aliases-generator.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/etc/udev/rules.d/80-programs.rules' as rules file
parse_file: reading '/etc/udev/rules.d/85-alsa.ru...

Read more...

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: [Bug 178065] Re: my udev rules do not work at all

On Tue, 2008-10-07 at 22:39 +0000, tsh wrote:

> udevinfo -a -p /sys/class/input/input7
> looking at device '/devices/pci0000:00/0000:00:0b.1/usb2/2-1/input/input7':
> KERNEL=="input7"
> SUBSYSTEM=="input"

vs.

> udevtest /class/input/event7
> udevtest: looking at device '/devices/pci0000:00/0000:00:0b.1/usb2/2-1/input/input7/event7' from subsystem 'input'
> udev_rules_get_name: rule applied, 'event7' becomes 'input/event7'

These are different devices.

Try removing the KERNEL=="input*" from your rule.

Scott
--
Scott James Remnant
<email address hidden>

Revision history for this message
tsh (tsh) wrote :

Thanks. My problem was user error.

Michael Nagel (nailor)
Changed in udev:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.