From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Michael Date: Tue, 03 Jul 2007 17:16:58 +0000 Subject: ENV{DEVNAME} in remove rule? Message-Id: <20070703171658.GB27375@server> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Hello, I'm learning my way around udev, and have written these rules to add a device: KERNEL=3D"sd*[!0-9]", ENV{ID_SERIAL}=3D"", IMPORT{program}=3D"/lib/udev/usb= _id -x" KERNEL=3D"sd*[!0-9]", ENV{ID_TYPE}=3D"?*", IMPORT{program}=3D"/lib/udev/pat= h_id %p" KERNEL=3D"sd*[!0-9]", ENV{ID_PATH}=3D"*usb-0:6:1.0*", NAME=3D"storage/raid-= $env{ID_BUS}-%M-%m" I want to run a command when it is removed, so I've written these rules: (The first rule is a catch-all where I do "set >> /tmp/debug" to see what's available in the environment..) SUBSYSTEM=3D"*", RUN+=3D"/root/udev-catch-remove" ENV{DEVNAME}=3D"/dev/storage/raid-*", RUN+=3D"/root/raid_management" When the device is disconnected, "udevmonitor --env" shows me: (DEVNAME appears just as I hoped..) UDEV [1183481937.246643] remove /block/sdc (block) UDEV_LOG=3D7 ACTION=3Dremove DEVPATH=3D/block/sdc SUBSYSTEM=3Dblock SEQNUM=1266 MINOR2 MAJOR=3D8 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb2/2-6/2-6:1.0/host15/targ= et15:0:0/15:0:0:0 PHYSDEVBUS=3Dscsi PHYSDEVDRIVER=3Dsd UDEVD_EVENT=3D1 ID_VENDOR=3DMaxtor_6 ID_MODEL=E040L0 ID_REVISION=0811 ID_SERIAL=3DMaxtor_6_E040L0 ID_TYPE=3Ddisk ID_BUS=3Dusb ID_PATH=3Dpci-0000:00:0b.1-usb-0:6:1.0-scsi-0:0:0:0 DEVLINKS=3D/dev/disk/by-id/usb-Maxtor_6_E040L0 /dev/disk/by-path/pci-0000:0= 0:0b.1-usb-0:6:1.0-scsi-0:0:0:0 DEVNAME=3D/dev/storage/raid-usb-8-32 But, my command /root/raid_management is never run, as if udev isn't matching ENV{DEVNAME}. What have I misunderstood? This is on Fedora 7 machine, using (slightly old) udev 106. ("rpm -q udev" =3D udev-106-4.fc7) Thanks, Richard ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel