From b8da356e5d81d4e87c74c093a7d27d4dc030b87f Mon Sep 17 00:00:00 2001 From: Alex Suykov Date: Sat, 23 May 2015 13:05:57 +0300 Subject: [PATCH] netplug: systemd support [Thomas: use relative symlink instead of absolute symlink.] Signed-off-by: Alex Suykov Signed-off-by: Thomas Petazzoni --- package/netplug/netplug.mk | 8 ++++++++ package/netplug/netplug.service | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 package/netplug/netplug.service diff --git a/package/netplug/netplug.mk b/package/netplug/netplug.mk index 0bd7c788ae..aeebcad2ee 100644 --- a/package/netplug/netplug.mk +++ b/package/netplug/netplug.mk @@ -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 index 0000000000..017a21f3f0 --- /dev/null +++ b/package/netplug/netplug.service @@ -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 -- 2.30.2