## **************************************************************************
## For copyright and licensing terms, see the file named COPYING.
## **************************************************************************

[Unit]
Description=%p service for device %I
Wants=kmod@vkbd.service %p-log.service
After=kmod@vkbd.service %p-log.service

[Service]
EnvironmentDirectory=env
ExecStart=%p -d -v ${flags} '/dev/%I'
# When the device is not a HID or a kernel driver is present and not detached, the daemon exits failure.
# When a device detaches, the daemon exits success.
# There is a window of opportunity of several seconds where devd/devpubd has not yet stopped the service during which re-opening the device and restarting the daemon will continually fail.
# We don't want the daemon auto-restarting in either case.
# But we do want a SIGTERM to auto-restart it.
Restart=on-signal

[Install]
