[systemd-devel] systemd unit review requested

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 4 22:50:54 PST 2013


When I fired up F20 on one of my laptops here I noticed that inputattach
doesn't work anymore for serial Wacom devices. It used to be started through
udev, but that doesn't work anymore. So moving to a systemd service it is,
but I'd like a review of the changes please.

The goal is to start inputattach for a serial Wacom device if the pnpid
matches a certain set. The old udev rule was:

SUBSYSTEM=="tty|pnp", KERNEL=="ttyS[0-9]*", ATTRS{id}=="WACf*", \
        RUN+="/usr/sbin/modprobe wacom_w8001", \
        RUN+="/usr/sbin/inputattach --daemon -w8001 /dev/%k"

the new rule now is:

SUBSYSTEM=="tty|pnp", KERNEL=="ttyS[0-9]*", ATTRS{id}=="WACf*", \
    ENV{SYSTEMD_WANTS}="wacom-inputattach@%k.service",TAG+="systemd"


And the matching wacom-inputattach at .service file shows:

[Unit]
Description="Start inputattach for Wacom ISDv4-compatible serial devices"

[Service]
Type=simple
ExecStartPre=/usr/sbin/modprobe wacom_w8001
ExecStart=/usr/bin/inputattach -w8001 /dev/%I

Anything I'm missing, anything I should change?

Also, do I need this in any target, or is dropping this into
/usr/lib/systemd/system/ enough?

Thanks in advance.

Cheers,
   Peter
~                                               



More information about the systemd-devel mailing list