[arch-general] udev rules 2 times exec script

Maykel Franco maykeldebian at gmail.com
Sat Jun 12 11:58:40 UTC 2021


Hi, I try configure the rule in udev for when I connect specific usb
device, launch script backup.

I have this rule:

/etc/udev/rules.d/10.autobackup.rules

SUBSYSTEM=="block", ACTION=="add", ATTRS{idVendor}=="058f",
ATTRS{idProduct}=="6387", SYMLINK+="external%n",
RUN+="/usr/local/bin/autobackup.sh"

This works well, buth exec 2 times the script...

Jun 12 13:53:09 archlaptop autobackup.sh: BEGIN SCRIPT
Jun 12 13:53:13 archlaptop autobackup.sh: BEGIN SCRIPT

I googled and I see this:

The issue was resolved by adding ENV{DEVTYPE}=="usb_device" in a rule.

If add ENV{DEVTYPE}=="usb_device" and change the
SUBSYSTEM=="usb_device" , when plug usb, udev does nothing ...

I don't understand why

udevadm info -a -p $(udevadm info -q path -n /dev/sda1)

https://pastebin.com/Zcz769BQ


More information about the arch-general mailing list