triggerhappy: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:14:07 +0000 (13:14 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 14 Jul 2015 13:51:01 +0000 (15:51 +0200)
[Thomas: use a relative symbolic link.]

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/triggerhappy/triggerhappy.mk
package/triggerhappy/triggerhappy.service [new file with mode: 0644]

index d3dfc6a18e12d2860eada9aff3a2454d638fe2ad..3a68e5094535671437aa8212b0742f0c41a35803 100644 (file)
@@ -34,4 +34,12 @@ define TRIGGERHAPPY_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S10triggerhappy
 endef
 
+define TRIGGERHAPPY_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/triggerhappy/triggerhappy.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/triggerhappy.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/triggerhappy.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/triggerhappy.service
+endef
+
 $(eval $(generic-package))
diff --git a/package/triggerhappy/triggerhappy.service b/package/triggerhappy/triggerhappy.service
new file mode 100644 (file)
index 0000000..8449c1c
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Description=Triggerhappy daemon
+
+[Service]
+ExecStart=/usr/sbin/thd --triggers /etc/triggerhappy/triggers.d --socket /var/run/thd.socket --user nobody /dev/input/event*
+Restart=always
+
+[Install]
+WantedBy=multi-user.target