Registration of TAG+="systemd" udev rules?

Ian Campbell ijc at debian.org
Sun May 10 17:02:33 BST 2015


On Sun, 2015-05-10 at 15:37 +0200, Michael Biebl wrote:
> Am 10.05.2015 um 14:46 schrieb Ian Campbell:
> > Hello,
> > 
> > In adding systemd unit support to the qcontrol package (#781886) I
> > needed to add a udev rule (60-qcontrol.rules):
> >         KERNELS=="gpio-keys", SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", TAG+="systemd"
> > 
> > In order to tag /dev/input/by-path/platform-gpio-keys-event for systemd,
> > so that the dev-input-by\x2dpath-platform\x2dgpio\x2dkeys
> > \x2devent.device unit works correctly and can be depended on by qcontrol.
> 
> That sounds wrong. Why would you want to do that?

The unit file, which was contributed upstream, contains:

        Requires=dev-input-by\x2dpath-platform\x2dgpio\x2dkeys\x2devent.device
        After=dev-input-by\x2dpath-platform\x2dgpio\x2dkeys\x2devent.device
        
I had no reason to doubt it was correct, since it seemed logical that a
daemon such depend on a device which it needs.

> If you want to start a service if hardware shows up, use SYSTEMD_WANTS
> in the rules file.

We want to start qcontrol on boot iff the device is present, which is
not quite the same as always starting qcontrol if the device is present
(which is how I understood
http://www.freedesktop.org/software/systemd/man/systemd.device.html to
explain SYSTEMD_WANTS). It seems strange to me to configure qcontrol to
start via udev properties.

> If you want to stop the service if the hardware goes away, use BindsTo=
> in the service file.

The hardware is part of the SoC, it isn't going anywhere ;-)

Ian.





More information about the Pkg-systemd-maintainers mailing list