[systemd-devel] systemd unit review requested
Peter Hutterer
peter.hutterer at who-t.net
Sun Dec 8 20:02:47 PST 2013
On Thu, Dec 05, 2013 at 01:24:10PM +0000, "Jóhann B. Guðmundsson" wrote:
[...]
> So we need an udev wacom-serial-driver rule that might look like
> this for the wacom serial devices
>
> ACTION=="remove", GOTO="drivers_end"
> ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}"
> SUBSYSTEM=="tty|pnp", SUBSYSTEMS=="pnp", ATTRS{id}=="WACf*",
> ENV{ID_MODEL}="Serial Wacom Tablet $attr{id}", ENV{ID_INPUT}="1",
> ENV{ID_INPUT_TABLET}="1", ENV{NAME}="Serial Wacom Tablet $attr{id}
> ,RUN{builtin}="kmod load wacom_w8001"
> SUBSYSTEM=="tty|pnp", SUBSYSTEMS=="pnp", ATTRS{id}=="FUJ*",
> ENV{ID_MODEL}="Serial Wacom Tablet $attr{id}", ENV{ID_INPUT}="1",
> ENV{ID_INPUT_TABLET}="1", ENV{NAME}="Serial Wacom Tablet $attr{id}
> ,RUN{builtin}="kmod load wacom_w8001"
> LABEL="drivers_end"
>
> Followed by an systemd rule that looks something like this
>
> SUBSYSTEM=="module", KERNEL=="wacom*", TAG+="systemd",
> ENV{SYSTEMD_WANTS}+="wacom-inputattach@%k.service"
>
> And the modprobe would be dropped from that unit file but as I say
> I'm not all that familiar with udev policy rules and I personally
> had not planned on mastering udev until I started the cleanup
> process in Fedora which might never happen today thanks to the that
> WG process.
I tested this today and it works, except for one issue where I got stuck:
since the actual service is now triggered by the module loading, %k now
refers to the module name, not to the actual device anymore. I'm not sure
how to get the device path (which I need for inputattach) from that.
otherwise it woks just fine :)
Cheers,
Peter
More information about the systemd-devel
mailing list