Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/collectd: add init script for SysV
@ 2019-10-26  5:50 Asaf Kahlon
  2019-10-26  6:58 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Asaf Kahlon @ 2019-10-26  5:50 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
---
 package/collectd/S90collectd | 33 +++++++++++++++++++++++++++++++++
 package/collectd/collectd.mk |  5 +++++
 2 files changed, 38 insertions(+)
 create mode 100644 package/collectd/S90collectd

diff --git a/package/collectd/S90collectd b/package/collectd/S90collectd
new file mode 100644
index 0000000000..5caff17238
--- /dev/null
+++ b/package/collectd/S90collectd
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+start() {
+	printf "Starting collectd... "
+	/usr/sbin/collectd
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+stop() {
+	printf "Stopping collectd... "
+	pkill collectd
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart|reload)
+	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?
diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
index 5d94dec46d..1bce196e7e 100644
--- a/package/collectd/collectd.mk
+++ b/package/collectd/collectd.mk
@@ -218,4 +218,9 @@ define COLLECTD_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/collectd.service
 endef
 
+define COLLECTD_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/collectd/S90collectd \
+		$(TARGET_DIR)/etc/init.d/S90collectd
+endef
+
 $(eval $(autotools-package))
-- 
2.20.1

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

* [Buildroot] [PATCH 1/1] package/collectd: add init script for SysV
  2019-10-26  5:50 [Buildroot] [PATCH 1/1] package/collectd: add init script for SysV Asaf Kahlon
@ 2019-10-26  6:58 ` Thomas Petazzoni
  2019-10-26  7:20   ` Asaf Kahlon
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2019-10-26  6:58 UTC (permalink / raw)
  To: buildroot

On Sat, 26 Oct 2019 08:50:13 +0300
Asaf Kahlon <asafka7@gmail.com> wrote:

> Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
> ---
>  package/collectd/S90collectd | 33 +++++++++++++++++++++++++++++++++
>  package/collectd/collectd.mk |  5 +++++
>  2 files changed, 38 insertions(+)
>  create mode 100644 package/collectd/S90collectd
> 
> diff --git a/package/collectd/S90collectd b/package/collectd/S90collectd
> new file mode 100644
> index 0000000000..5caff17238
> --- /dev/null
> +++ b/package/collectd/S90collectd
> @@ -0,0 +1,33 @@
> +#!/bin/sh
> +
> +start() {
> +	printf "Starting collectd... "
> +	/usr/sbin/collectd

I think we like to use start-stop-daemon in our init scripts. Any
reason why you're not using start-stop-daemon here ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/1] package/collectd: add init script for SysV
  2019-10-26  6:58 ` Thomas Petazzoni
@ 2019-10-26  7:20   ` Asaf Kahlon
  0 siblings, 0 replies; 3+ messages in thread
From: Asaf Kahlon @ 2019-10-26  7:20 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, Oct 26, 2019 at 9:58 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> On Sat, 26 Oct 2019 08:50:13 +0300
> Asaf Kahlon <asafka7@gmail.com> wrote:
>
> > Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
> > ---
> >  package/collectd/S90collectd | 33 +++++++++++++++++++++++++++++++++
> >  package/collectd/collectd.mk |  5 +++++
> >  2 files changed, 38 insertions(+)
> >  create mode 100644 package/collectd/S90collectd
> >
> > diff --git a/package/collectd/S90collectd b/package/collectd/S90collectd
> > new file mode 100644
> > index 0000000000..5caff17238
> > --- /dev/null
> > +++ b/package/collectd/S90collectd
> > @@ -0,0 +1,33 @@
> > +#!/bin/sh
> > +
> > +start() {
> > +     printf "Starting collectd... "
> > +     /usr/sbin/collectd
>
> I think we like to use start-stop-daemon in our init scripts. Any
> reason why you're not using start-stop-daemon here ?

Nothing special, I sent a v2.

>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Regards,
Asaf.

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

end of thread, other threads:[~2019-10-26  7:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-26  5:50 [Buildroot] [PATCH 1/1] package/collectd: add init script for SysV Asaf Kahlon
2019-10-26  6:58 ` Thomas Petazzoni
2019-10-26  7:20   ` Asaf Kahlon

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