Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] thttpd: add systemd service file
@ 2015-03-19 19:57 Mike Williams
  2015-03-20 10:22 ` Samuel Martin
  2015-03-20 13:24 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Williams @ 2015-03-19 19:57 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Mike Williams <mike@mikebwilliams.com>
---
 package/thttpd/thttpd.mk      |  5 +++++
 package/thttpd/thttpd.service | 10 ++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 package/thttpd/thttpd.service

diff --git a/package/thttpd/thttpd.mk b/package/thttpd/thttpd.mk
index 1a028c8..565ade6 100644
--- a/package/thttpd/thttpd.mk
+++ b/package/thttpd/thttpd.mk
@@ -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))
diff --git a/package/thttpd/thttpd.service b/package/thttpd/thttpd.service
new file mode 100644
index 0000000..e3c93e7
--- /dev/null
+++ b/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
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] thttpd: add systemd service file
  2015-03-19 19:57 [Buildroot] [PATCH] thttpd: add systemd service file Mike Williams
@ 2015-03-20 10:22 ` Samuel Martin
  2015-03-20 13:24 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Martin @ 2015-03-20 10:22 UTC (permalink / raw)
  To: buildroot

Hi Mike,

On Thu, Mar 19, 2015 at 8:57 PM, Mike Williams <mike@mikebwilliams.com> wrote:
> Based on Arch service file, adjust to point to /usr/sbin.
>
> Signed-off-by: Mike Williams <mike@mikebwilliams.com>
> ---
>  package/thttpd/thttpd.mk      |  5 +++++
>  package/thttpd/thttpd.service | 10 ++++++++++
>  2 files changed, 15 insertions(+)
>  create mode 100644 package/thttpd/thttpd.service
>
> diff --git a/package/thttpd/thttpd.mk b/package/thttpd/thttpd.mk
> index 1a028c8..565ade6 100644
> --- a/package/thttpd/thttpd.mk
> +++ b/package/thttpd/thttpd.mk
> @@ -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,

-- 
Samuel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] thttpd: add systemd service file
  2015-03-19 19:57 [Buildroot] [PATCH] thttpd: add systemd service file Mike Williams
  2015-03-20 10:22 ` Samuel Martin
@ 2015-03-20 13:24 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2015-03-20 13:24 UTC (permalink / raw)
  To: buildroot

Dear Mike Williams,

On Thu, 19 Mar 2015 15:57:54 -0400, Mike Williams wrote:
> Based on Arch service file, adjust to point to /usr/sbin.
> 
> Signed-off-by: Mike Williams <mike@mikebwilliams.com>
> ---
>  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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-20 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-19 19:57 [Buildroot] [PATCH] thttpd: add systemd service file Mike Williams
2015-03-20 10:22 ` Samuel Martin
2015-03-20 13:24 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox