[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [sane-devel] Calling a script after USB scanner is plugged



Johannes Meixner <jsmeix@suse.de> wrote:

Hi,

>> > Be careful with the labels you use. Always use a unique label name, or
>> > you're asking for troubles. (been there, done that, accidentally
>> > rendered a number of systems unbootable due to that ...)
>
> Many thanks for this enlightening info!
> Impressive: A thoroughly thought out fail-safe design!

udev is an incredible piece of crap, but the good news is that this
piece of crap is mostly stable those days. Which is a big step forward
already.

(and I'll refrain from saying anything at all about the genius who
invented udev. I'll just mention that he's also the author of "stable
API is a nonsense".)

> I can only guess that what udev actually does is to
> concatenate all udev rules files into one single set
> of rules and then it is not surprising when arbitrary
> nonsense happens depending on which individual udev rules
> files exist on a particular system which depends on which
> individual software packages are installed on this system.

You got it.

> Very nice to debug!

deWHAT?

>> I tried that before after I saw the z60_libsane.rules
>> 
>> ACTION!="add", GOTO="post_lamp_off"
>> SYSFS{idVendor}=="1606", SYSFS{idProduct}=="0010", MODE="0664", 
>> GROUP="scanner", NAME="umax%n", RUN+="/usr/local/bin/umax1220u start", 
>> ENV{lamp_off}="yes"
>> LABEL="post_lamp_off"
>> 
>> But given the events, it is obvious not surprising that this is not working.

>> Is anybody aware of a more elegant solution for this problem?

You need to copy a bit more than that from. See the top of the file,
there's more to it than that, also the way to identify a USB device
event changed starting with 2.6.22 and the rules are
backward-compatible in this respect too.

> You cannot have "udev" and "elegant" at the same time

Actually, you can, but you need a bit of udev/uevent knowledge and
some time on your hands.

> and you cannot have "HAL" and "elegant" at the same time.

It's all HALegant, pff.


Welcome to udev-land, Johannes!

JB.

-- 
Julien BLACHE                                   <http://www.jblache.org> 
<jb@jblache.org>                                  GPG KeyID 0xF5D65169


Reply to: