From 7ee5eb933d9d148d31598adafc41cf7fd4c76c9a Mon Sep 17 00:00:00 2001 From: Alex Suykov Date: Sat, 23 May 2015 13:14:07 +0300 Subject: [PATCH] triggerhappy: systemd support [Thomas: use a relative symbolic link.] Signed-off-by: Alex Suykov Signed-off-by: Thomas Petazzoni --- package/triggerhappy/triggerhappy.mk | 8 ++++++++ package/triggerhappy/triggerhappy.service | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 package/triggerhappy/triggerhappy.service diff --git a/package/triggerhappy/triggerhappy.mk b/package/triggerhappy/triggerhappy.mk index d3dfc6a18e..3a68e50945 100644 --- a/package/triggerhappy/triggerhappy.mk +++ b/package/triggerhappy/triggerhappy.mk @@ -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 index 0000000000..8449c1c935 --- /dev/null +++ b/package/triggerhappy/triggerhappy.service @@ -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 -- 2.30.2