diff mbox

[30/38] tinyhttpd: systemd support

Message ID 4de07aed2aa8ff5ece608548b6eed6d357f14a3f.1432332802.git.alex.suykov@gmail.com
State Accepted
Headers show

Commit Message

Alex Suykov May 23, 2015, 10:08 a.m. UTC
Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
---
 package/tinyhttpd/tinyhttpd.mk      |  8 ++++++++
 package/tinyhttpd/tinyhttpd.service | 10 ++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 package/tinyhttpd/tinyhttpd.service

Comments

Thomas Petazzoni July 14, 2015, 12:04 p.m. UTC | #1
Dear Alex Suykov,

On Sat, 23 May 2015 13:08:37 +0300, Alex Suykov wrote:
> Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
> ---
>  package/tinyhttpd/tinyhttpd.mk      |  8 ++++++++
>  package/tinyhttpd/tinyhttpd.service | 10 ++++++++++
>  2 files changed, 18 insertions(+)
>  create mode 100644 package/tinyhttpd/tinyhttpd.service

Applied after changing the link to use a relative path, thanks.

Thomas
diff mbox

Patch

diff --git a/package/tinyhttpd/tinyhttpd.mk b/package/tinyhttpd/tinyhttpd.mk
index 0934b71..998ed26 100644
--- a/package/tinyhttpd/tinyhttpd.mk
+++ b/package/tinyhttpd/tinyhttpd.mk
@@ -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
index 0000000..0ae5bac
--- /dev/null
+++ b/package/tinyhttpd/tinyhttpd.service
@@ -0,0 +1,10 @@ 
+[Unit]
+Description=Tiny HTTP daemon
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/tinyhttpd
+Restart=always
+
+[Install]
+WantedBy=multi-user.target