Re: udev rules 2 times exec script

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



On Sat, 12 Jun 2021 at 13:59, Maykel Franco via arch-general
<arch-general@xxxxxxxxxxxxxxxxxxx> 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



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux