[systemd-devel] systemd unit review requested
"Jóhann B. Guðmundsson"
johannbg at gmail.com
Thu Dec 5 05:24:10 PST 2013
On 12/05/2013 12:28 PM, Michael Biebl wrote:
> 2013/12/5 "Jóhann B. Guðmundsson"<johannbg at gmail.com>:
>> On 12/05/2013 06:50 AM, Peter Hutterer wrote:
>>> ExecStartPre=/usr/sbin/modprobe wacom_w8001
>> Add a configuration file called wacom-w8001.conf to /etc/modules-load.d
>> directory with the following content to load the module
>> ( /etc/modules-load.d/wacom-w8001.conf )
>> # Load wacom_w8001 at boot
>> wacom_w8001
> Well, this loads the kernel module unconditionally, though. Even for
> users which don't have that hardware. So this approach isn't that
> great.
>
> It also depends on the wacom_w8001 and how it reacts when it's loaded
> and no hardware is present.
>
> Peter, couldn't this module be autoloaded?
I'm not that familiar with udev policy regarding rules rule but I would
think that if you autoload module you tie the startup of the systemd
unit to the module being loaded ( if the intent is to trigger a unit )
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.
JBG
More information about the systemd-devel
mailing list