package/collectd: add init script for SysV
PATCH 1/1 package/collectd: add init script for SysV
Signed-off-by Asaf Kahlon <[email protected]>
--- package/collectd/S90collectd | 33 +++++++++++++++++++++++++++++++++ package/collectd/collectd.mk | 5 +++++ 2 files changed, 38 insertions(+) create mode 100644 package/collectd/S90collectd
package/collectd/S90collectd new file +33 -0
@@ -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 $?
package/collectd/collectd.mk +5 -0
@@ -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))
Signature · 1 line
2.20.1
PATCH 1/1 package/collectd: add init script for SysV
Quoted 13 lines · On Sat, 26 Oct 2019 08:50:13 +0300 Asaf Kahlon <[email protected]> wrote:
Signed-off-by Asaf Kahlon <[email protected]>--- package/collectd/S90collectd | 33 +++++++++++++++++++++++++++++++++ package/collectd/collectd.mk | 5 +++++ 2 files changed, 38 insertions(+) create mode 100644 package/collectd/S90collectdpackage/collectd/S90collectd new file +0
-0
package/collectd/S90collectd line 5
Quoted 5 lines
package/collectd/S90collectd new file +5
-0@@ -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
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 package/collectd: add init script for SysV
Hello,
Quoted 11 lines · Thomas Petazzoni
Quoted 7 lines · On Sat, 26 Oct 2019 08:50:13 +0300 Asaf Kahlon <[email protected]> wrote:
Signed-off-by Asaf Kahlon <[email protected]>--- package/collectd/S90collectd | 33 +++++++++++++++++++++++++++++++++ package/collectd/collectd.mk | 5 +++++ 2 files changed, 38 insertions(+) create mode 100644 package/collectd/S90collectd
Quoted 14 lines
package/collectd/S90collectd line 5
Quoted 11 lines
package/collectd/S90collectd new file +5
-0@@ -0,0 +1,33 @@ +#!/bin/sh + +start() { + printf "Starting collectd... " + /usr/sbin/collectdI 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.
Quoted 8 lines
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Regards,
Asaf.