В Sun, 30 Mar 2014 23:48:11 +0800
Kai Hendry <hen...@webconverger.com> пишет:

> On 26 March 2014 22:55, "Jóhann B. Guðmundsson" <johan...@gmail.com> wrote:
> > SUBSYSTEM=="input", ENV{ID_INPUT_KEYBOARD}=="?*", ENV{.INPUT_CLASS}="kbd",
> > TAG+="systemd", ENV{SYSTEMD_WANTS}+="shkd@%p.service"
> 
...
> Trying to teach myself how to fish here. How did you know it would
> match this particular device?
> 
> $ udevadm monitor

udevadm monitor --env would be more useful, it also shows device
attributes after event is processed.

...
> 
> Anyway, it doesn't seem to work.
> 
> [hendry@alarmpi ~]$ systemctl | grep shk
> shkd@-devices-platform-bcm2708_usb-usb1-1-1-1-1.2-1-1.2.2-1-1.2.2:1.0-input-input0-event0.service
>                               loaded failed     failed       Simple
> HotKey Daemon


That's right. You really want %N ($devnode), not %p in the rule. %p
refers to path in /sys, while your daemon apparently needs real device
path in /dev.

To filter those paths that generate device nodes you could check for
DEVNAME or NAME not being empty. If you need more specific match, you
need to check attributes for your device.

SUBSYSTEM=="input", ENV{ID_INPUT_KEYBOARD}=="?*", ENV{DEVNAME}=="?*", \
TAG+="systemd", ENV{SYSTEMD_WANTS}+="shkd@%N.service"
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to