package/acpid: add systemd service
authorAlexander Sverdlin <alexander.sverdlin@gmail.com>
Tue, 13 Nov 2018 20:17:28 +0000 (21:17 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 13 Nov 2018 21:02:59 +0000 (22:02 +0100)
This one is based on Archlinux's service file.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/acpid/acpid.mk
package/acpid/acpid.service [new file with mode: 0644]

index 48fe005e5e1104a69c4f320f3f17c5a1c8f130df..514fd31fe6769b23aa00f1a41baaa4b564c15e33 100644 (file)
@@ -10,6 +10,14 @@ ACPID_SITE = http://downloads.sourceforge.net/project/acpid2
 ACPID_LICENSE = GPL-2.0+
 ACPID_LICENSE_FILES = COPYING
 
+define ACPID_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 0755 package/acpid/acpid.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/acpid.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/acpid.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/acpid.service
+endef
+
 define ACPID_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 0755 package/acpid/S02acpid \
                $(TARGET_DIR)/etc/init.d/S02acpid
diff --git a/package/acpid/acpid.service b/package/acpid/acpid.service
new file mode 100644 (file)
index 0000000..5252b52
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Description=ACPI event daemon
+Documentation=man:acpid(8)
+
+[Service]
+ExecStart=/usr/sbin/acpid --foreground --netlink
+
+[Install]
+WantedBy=multi-user.target