olsr: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:06:09 +0000 (13:06 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 14 Jul 2015 09:53:44 +0000 (11:53 +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/olsr/olsr.mk
package/olsr/olsr.service [new file with mode: 0644]

index 7e28b1e411cd224ef80b49611e3694275f2d1a18..0dec8dc002578944fe966fcc088890db81ea2997 100644 (file)
@@ -40,4 +40,12 @@ define OLSR_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S50olsr
 endef
 
+define OLSR_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/olsr/olsr.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/olsr.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/olsr.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/olsr.service
+endef
+
 $(eval $(generic-package))
diff --git a/package/olsr/olsr.service b/package/olsr/olsr.service
new file mode 100644 (file)
index 0000000..9ec8930
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Ad-hoc wireless mesh routing daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/olsrd -nofork
+Restart=always
+
+[Install]
+WantedBy=multi-user.target