netplug: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:05:57 +0000 (13:05 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 13 Jul 2015 21:23:57 +0000 (23:23 +0200)
[Thomas: use relative symlink instead of absolute symlink.]

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

index 0bd7c788aeae33685b6e583ffd66c113d1a5661c..aeebcad2eefe8442bfce05697d8291f159af18f5 100644 (file)
@@ -23,4 +23,12 @@ define NETPLUG_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S29netplug
 endef
 
+define NETPLUG_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/netplug/netplug.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/netplug.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/netplug.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/netplug.service
+endef
+
 $(eval $(generic-package))
diff --git a/package/netplug/netplug.service b/package/netplug/netplug.service
new file mode 100644 (file)
index 0000000..017a21f
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Network cable hotplug management daemon
+After=syslog.target network.target
+
+[Service]
+ExecStart=/sbin/netplugd -F
+Restart=always
+
+[Install]
+WantedBy=multi-user.target