* action does not trigger on remove, only on add
@ 2006-03-28 18:00 Moshe Yudkowsky
2006-03-28 18:05 ` Kay Sievers
2006-03-28 19:08 ` Moshe Yudkowsky
0 siblings, 2 replies; 3+ messages in thread
From: Moshe Yudkowsky @ 2006-03-28 18:00 UTC (permalink / raw)
To: linux-hotplug
I must be missing something quite obvious.
Here are two rules:
SUBSYSTEM="block", ACTION="add", SYSFS{vendor}="iriver",
SYMLINK="iriver", RUN+="/etc/hotplug/usb/iriver"
SUBSYSTEM="block", ACTION="remove", SYSFS{vendor}="iriver",
RUN+="/etc/hotplug/usb/iriver"
The first one works quite nicely, and I can see the program in RUN
execute. The second rule does not run the program as far as I can tell.
I do see the "remove" event:
UDEV [1143466033.007580] remove@/block/sdc
UDEV_LOG=3
ACTION=remove
DEVPATH=/block/sdc
SUBSYSTEM=block
SEQNUM$91
MINOR2
MAJOR=8
PHYSDEVPATH=/devices/pci0000:00/0000:00:10.3/usb4/4-4/4-4:1.0/host11/target11:0:0/11:0:0:0
PHYSDEVBUS=scsi
PHYSDEVDRIVER=sd
UDEVD_EVENT=1
DEVLINKS=/dev/iriver /dev/sdc /dev/discs/disc2/disc
/dev/disk/by-id/usb-iriver_MassStorage_Disc
/dev/disk/by-path/usb-iRiverLimited-IFP-700HIGHSPEED:0:0:0
DEVNAME=/dev/scsi/host11/bus0/target0/lun0/disc
ID_VENDOR=iriver
ID_MODEL=MassStorage_Disc
ID_REVISION\001
ID_SERIAL=iriver_MassStorage_Disc
ID_TYPE=disk
ID_BUS=usb
ID_PATH=usb-iRiverLimited-IFP-700HIGHSPEED:0:0:0
so I can't quite figure out why the program doesn't execute. This worked
in the past but stopped working a few releases back, and now it's
starting to bother me.
--
Moshe Yudkowsky
work: http://www.Disaggregate.com
book: http://www.PebbleAndAvalanche.com
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: action does not trigger on remove, only on add
2006-03-28 18:00 action does not trigger on remove, only on add Moshe Yudkowsky
@ 2006-03-28 18:05 ` Kay Sievers
2006-03-28 19:08 ` Moshe Yudkowsky
1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2006-03-28 18:05 UTC (permalink / raw)
To: linux-hotplug
On Tue, Mar 28, 2006 at 12:00:41PM -0600, Moshe Yudkowsky wrote:
> I must be missing something quite obvious.
>
> Here are two rules:
>
> SUBSYSTEM="block", ACTION="add", SYSFS{vendor}="iriver",
> SYMLINK="iriver", RUN+="/etc/hotplug/usb/iriver"
>
> SUBSYSTEM="block", ACTION="remove", SYSFS{vendor}="iriver",
> RUN+="/etc/hotplug/usb/iriver"
>
> The first one works quite nicely, and I can see the program in RUN
> execute. The second rule does not run the program as far as I can tell.
>
> I do see the "remove" event:
>
> UDEV [1143466033.007580] remove@/block/sdc
> UDEV_LOG=3
> ACTION=remove
> DEVPATH=/block/sdc
> SUBSYSTEM=block
> SEQNUM$91
> MINOR2
> MAJOR=8
> PHYSDEVPATH=/devices/pci0000:00/0000:00:10.3/usb4/4-4/4-4:1.0/host11/target11:0:0/11:0:0:0
> PHYSDEVBUS=scsi
> PHYSDEVDRIVER=sd
> UDEVD_EVENT=1
> DEVLINKS=/dev/iriver /dev/sdc /dev/discs/disc2/disc
> /dev/disk/by-id/usb-iriver_MassStorage_Disc
> /dev/disk/by-path/usb-iRiverLimited-IFP-700HIGHSPEED:0:0:0
> DEVNAME=/dev/scsi/host11/bus0/target0/lun0/disc
> ID_VENDOR=iriver
> ID_MODEL=MassStorage_Disc
> ID_REVISION\001
> ID_SERIAL=iriver_MassStorage_Disc
> ID_TYPE=disk
> ID_BUS=usb
> ID_PATH=usb-iRiverLimited-IFP-700HIGHSPEED:0:0:0
>
> so I can't quite figure out why the program doesn't execute. This worked
> in the past but stopped working a few releases back, and now it's
> starting to bother me.
This never worked, cause there are no sysfs files to match against
when the device is gone.
Kay
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: action does not trigger on remove, only on add
2006-03-28 18:00 action does not trigger on remove, only on add Moshe Yudkowsky
2006-03-28 18:05 ` Kay Sievers
@ 2006-03-28 19:08 ` Moshe Yudkowsky
1 sibling, 0 replies; 3+ messages in thread
From: Moshe Yudkowsky @ 2006-03-28 19:08 UTC (permalink / raw)
To: linux-hotplug
> This never worked, cause there are no sysfs files to match against
> when the device is gone.
OK, it must have been some previous script that worked on unplug. What
would be the correct way -- the recommended, best-practices way -- to
match on unplug, if I match on a SYSFS variable on plugin?
If udevmonitor shows:
> ID_VENDOR=iriver
> ID_MODEL=MassStorage_Disc
> ID_REVISION\001
> ID_SERIAL=iriver_MassStorage_Disc
> ID_TYPE=disk
> ID_BUS=usb
then in what way is ID_VENDOR accessible to a script?
I could set an ENV variable on plugin and then match it again at
unplug, I suppose. But is there a better method? ENV is a bit difficult
to work with because it doesn't accept %p and similar variables to set.
While I can certainly code a solution that fixes just this problem, I
prefer broader solutions.
Here's a plea for some slight changes in the output format for
udevmonitor. One problem I always have whenever I sit down to work with
udev is matching the output of udevmonitor with the various variables
mentioned in the documentaion. I.e., the output of udevmonitor shows
ID_PATH, and that'd be a fine key to match against. Is ID_PATH the same
as %p? No, but then what is this ID_KEY? What line in udevmonitor's
output matches to %id as mentioned in the man page? MAJOR and MINOR are
easy enough, but all these others can be a real puzzle -- even though
the information is right there in udevmonitor's output. udevinfo seems a
lot better about showing what's sysfs{}, and that's a big help.
--
Moshe Yudkowsky
work: http://www.Disaggregate.com
book: http://www.PebbleAndAvalanche.com
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-28 19:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-28 18:00 action does not trigger on remove, only on add Moshe Yudkowsky
2006-03-28 18:05 ` Kay Sievers
2006-03-28 19:08 ` Moshe Yudkowsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).