udev rules and key equality - Debian

This is a discussion on udev rules and key equality - Debian ; Any udev prodigies? I have the following 2 user rules defined. BUS=="usb", KERNEL=="sdc[1-9]", ATTRS{serial}=="0C01076160E298A4", SYMLINK="u3_drive", RUN+="/usr/bin/setsid /root/bu/partialbu.sh u3_drive" BUS=="usb", KERNEL=="sd??", ATTRS{serial}=="0002F775867C431A", SYMLINK="muvo_drive", RUN+="/usr/bin/setsid /root/bu/bu.sh muvo_drive" obviously they are on one line each. But when I plug in the MuVO it ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: udev rules and key equality

  1. udev rules and key equality

    Any udev prodigies?
    I have the following 2 user rules defined.

    BUS=="usb", KERNEL=="sdc[1-9]",
    ATTRS{serial}=="0C01076160E298A4",
    SYMLINK="u3_drive",
    RUN+="/usr/bin/setsid /root/bu/partialbu.sh
    u3_drive"

    BUS=="usb", KERNEL=="sd??",
    ATTRS{serial}=="0002F775867C431A",
    SYMLINK="muvo_drive",
    RUN+="/usr/bin/setsid /root/bu/bu.sh muvo_drive"

    obviously they are on one line each.
    But when I plug in the MuVO it is sometimes sdc1. The first rule
    will match and run the backup even though the serial DOES NOT
    match. It's driving me nuts!
    The way I have them coded doesn't the serial number make them
    very unique? It seems to be ignoring that key comparison.
    I would expect kernel to match then serial to not match and
    move on to the next rule?

    Thanks for any help.
    -Walt

  2. Re: udev rules and key equality

    PenguinsAnonymous@notAchance.org wrote:
    > Any udev prodigies?
    > I have the following 2 user rules defined.
    >
    > BUS=="usb", KERNEL=="sdc[1-9]",
    > ATTRS{serial}=="0C01076160E298A4",
    > SYMLINK="u3_drive",
    > RUN+="/usr/bin/setsid /root/bu/partialbu.sh
    > u3_drive"


    Your UDEV probably doesn't understand ATTRS{} yet.
    Either upgrade UDEV, or replace ATTRS{} with SYSFS{}.

    >
    > BUS=="usb", KERNEL=="sd??",
    > ATTRS{serial}=="0002F775867C431A",
    > SYMLINK="muvo_drive",
    > RUN+="/usr/bin/setsid /root/bu/bu.sh muvo_drive"


    Same here.

  3. Re: udev rules and key equality

    Ben Peddell wrote:
    > PenguinsAnonymous@notAchance.org wrote:
    >> Any udev prodigies?
    >> I have the following 2 user rules defined.
    >>
    >> BUS=="usb", KERNEL=="sdc[1-9]",
    >> ATTRS{serial}=="0C01076160E298A4",
    >> SYMLINK="u3_drive",
    >> RUN+="/usr/bin/setsid /root/bu/partialbu.sh
    >> u3_drive"

    >
    > Your UDEV probably doesn't understand ATTRS{} yet.
    > Either upgrade UDEV, or replace ATTRS{} with SYSFS{}.
    >
    >>
    >> BUS=="usb", KERNEL=="sd??",
    >> ATTRS{serial}=="0002F775867C431A",
    >> SYMLINK="muvo_drive",
    >> RUN+="/usr/bin/setsid /root/bu/bu.sh muvo_drive"

    >
    > Same here.


    Do you know relatively how old sysfs usage is? Since the
    beginning of udev?

    Thanks.

  4. Re: udev rules and key equality


    > Do you know relatively how old sysfs usage is? Since the
    > beginning of udev?
    >


    Sorry I meant attrs. My kernel isn't all that old at 2.6.18
    and udev-104-r11.
    At any rate it appears your analysis is correct.
    Changing attrs to sysfs fixed the problem.
    Thanks.
    -Walt

+ Reply to Thread