tinyhttpd: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:08:37 +0000 (13:08 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 14 Jul 2015 12:03:03 +0000 (14:03 +0200)
[Thomas: use relative symlink.]

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

index 0934b71034003912115ea0529a963957900af39f..194249bd1f0e8d15bf2985e4f5e3669c7c85ca76 100644 (file)
@@ -24,4 +24,12 @@ define TINYHTTPD_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S85tinyhttpd
 endef
 
+define TINYHTTPD_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/tinyhttpd/tinyhttpd.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/tinyhttpd.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/tinyhttpd.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/tinyhttpd.service
+endef
+
 $(eval $(generic-package))
diff --git a/package/tinyhttpd/tinyhttpd.service b/package/tinyhttpd/tinyhttpd.service
new file mode 100644 (file)
index 0000000..0ae5bac
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Tiny HTTP daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/tinyhttpd
+Restart=always
+
+[Install]
+WantedBy=multi-user.target