Skip to contentSkip to conversation

thttpd: add systemd service file

PATCH New Mike Williams 3 participants 3 messages Mar 19, 2015 – Mar 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thttpd: add systemd service file

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

---
 package/thttpd/thttpd.mk      |  5 +++++
 package/thttpd/thttpd.service | 10 ++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 package/thttpd/thttpd.service
package/thttpd/thttpd.mk +5 -0
index 1a028c8..565ade6 100644
@@ -44,4 +44,9 @@ 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
+	ln -fs /usr/lib/systemd/system/thttpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/thttpd.service
+endef
+
 $(eval $(autotools-package))
package/thttpd/thttpd.service new file +10 -0
new file mode 100644
index 0000000..e3c93e7
@@ -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
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/1 thttpd: add systemd service file

Hi Mike,

Quoted 14 lines · Mike Williams

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

---
 package/thttpd/thttpd.mk      |  5 +++++
 package/thttpd/thttpd.service | 10 ++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 package/thttpd/thttpd.service
package/thttpd/thttpd.mk +0 -0
index 1a028c8..565ade6 100644

package/thttpd/thttpd.mk define THTTPD_INSTALL_INIT_SYSV · line 49

Quoted 6 lines
package/thttpd/thttpd.mk +3 -0
@@ -44,4 +44,9 @@ 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
+       ln -fs /usr/lib/systemd/system/thttpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/thttpd.service

Please wrap these long lines.

Regards,

Signature · 1 line
Samuel
#2 lore raw

PATCH 1/1 thttpd: add systemd service file

In reply to Mike Williams

Dear Mike Williams,

Quoted 8 lines · Mike Williams

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

---
 package/thttpd/thttpd.mk      |  5 +++++
 package/thttpd/thttpd.service | 10 ++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 package/thttpd/thttpd.service

Since this assumes we install systemd unit files in /usr/lib, could you take this patch as part of your "RFC: systemd and service files cleanup" series?

See my question about this series related to symbolic links (absolute vs. relative), and adapt this patch as well accordingly.

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com