[systemd-devel] systemd195: issue with udev launched script

Kay Sievers kay at vrfy.org
Thu Nov 15 12:05:02 PST 2012


On Thu, Nov 15, 2012 at 7:40 PM, Warpme <warpme at o2.pl> wrote:
> Sometime ago upgraded my ArchLinux (kernel3.3.8) server to systemd195.
> Today I discovered that my backup procedure fails. It was working OK with
> previous systemd.
> Forgive me if this forum is wrong place to ask such questions, but as udev
> is now part of systemd - I decided to ask here...
> I know that long tasks launched by udev should be detached.
> Maybe some merciful soul help me with finding error in following approach:
> (maybe there is better way do to launching scripts on USN attach ?)

Udev even handlers cannot run long running processes, they get cleaned
up after a timeout. That's what you see here.

Udev events are timing critical, and they might block the entire
bootup if they do not return in time. There is no sane way to make
udev run such scripts, handle that properly. It is not really made to
start such services.

You can use systemd to instantiate a service on device discovery (or
run a daemon that listens to events from udev on old init systems).

Check how bluetooth, cups printers, usbmux, ... is handled:
  TAG+="systemd",
ENV{SYSTEMD_WANTS}="configure-printer at usb-$env{BUSNUM}-$env{DEVNUM}.service"
  TAG+="systemd", ENV{SYSTEMD_WANTS}+="bluetooth.target"
  TAG+="systemd", ENV{SYSTEMD_WANTS}="usbmuxd.service"

Kay


More information about the systemd-devel mailing list