浏览代码

thttpd: add systemd service file

Based on Arch service file, adjusted to point to /usr/sbin.

Signed-off-by: Mike Williams <mike@mikebwilliams.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mike Williams 10 年之前
父节点
当前提交
c85b3fca39
共有 2 个文件被更改,包括 18 次插入0 次删除
  1. 8 0
      package/thttpd/thttpd.mk
  2. 10 0
      package/thttpd/thttpd.service

+ 8 - 0
package/thttpd/thttpd.mk

@@ -44,4 +44,12 @@ define THTTPD_INSTALL_INIT_SYSV
 	$(SED) 's:/usr/local/sbin:/usr/sbin:g' $(TARGET_DIR)/etc/init.d/S90thttpd
 endef
 
+define THTTPD_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 package/thttpd/thttpd.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/thttpd.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/
+	ln -fs ../../../../usr/lib/systemd/system/thttpd.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/thttpd.service
+endef
+
 $(eval $(autotools-package))

+ 10 - 0
package/thttpd/thttpd.service

@@ -0,0 +1,10 @@
+[Unit]
+Description=Tiny HTTP Daemon
+
+[Service]
+PIDFile=/run/thttpd.pid
+ExecStart=/usr/sbin/thttpd -D -C /etc/thttpd.conf
+Restart=always
+
+[Install]
+WantedBy=multi-user.target