[arch-general] udev rules 2 times exec script

Damjan Georgievski gdamjan at gmail.com
Sun Jun 13 18:19:58 UTC 2021


On Sat, 12 Jun 2021 at 13:59, Maykel Franco via arch-general
<arch-general at lists.archlinux.org> wrote:
>
> 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"


you'd be better of if you use an oneshot systemd service for this.
See https://www.freedesktop.org/software/systemd/man/systemd.device.html#SYSTEMD_WANTS=

RUN in udev rules is not meant for any long-running processes,
actually only very short running processes
https://www.freedesktop.org/software/systemd/man/udev.html#RUN%7Btype%7D

-- 
damjan


More information about the arch-general mailing list