thttpd: add systemd service file
PATCH 1/1 thttpd: add systemd service file
Based on Arch service file, adjust to point to /usr/sbin.
Signed-off-by Mike Williams <[email protected]>
--- 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
@@ -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
@@ -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
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.Signed-off-by Mike Williams <[email protected]>--- package/thttpd/thttpd.mk | 5 +++++ package/thttpd/thttpd.service | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 package/thttpd/thttpd.servicepackage/thttpd/thttpd.mk +0
-0
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
PATCH 1/1 thttpd: add systemd service file
In reply to Mike WilliamsDear Mike Williams,
Quoted 8 lines · Mike Williams
Based on Arch service file, adjust to point to
/usr/sbin.Signed-off-by Mike Williams <[email protected]>--- 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