aboutsummaryrefslogtreecommitdiffstats
path: root/testing/telegraf/telegraf.initd
diff options
context:
space:
mode:
authorFusl <root@hallowe.lt>2018-01-28 09:16:44 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-02-20 18:07:27 +0000
commitb278ca91122ed0faee3da41f801d7cb0c33c9473 (patch)
tree6a3caf9641c52b31487ee7ccbb77140a354dc4b4 /testing/telegraf/telegraf.initd
parentb7e46cc1a7a6a945194e82f1c9d06e6230877355 (diff)
downloadaports-b278ca91122ed0faee3da41f801d7cb0c33c9473.tar.bz2
aports-b278ca91122ed0faee3da41f801d7cb0c33c9473.tar.xz
testing/telegraf: new aport
Diffstat (limited to 'testing/telegraf/telegraf.initd')
-rw-r--r--testing/telegraf/telegraf.initd39
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/telegraf/telegraf.initd b/testing/telegraf/telegraf.initd
new file mode 100644
index 0000000000..9f8e0cf0c0
--- /dev/null
+++ b/testing/telegraf/telegraf.initd
@@ -0,0 +1,39 @@
+#!/sbin/openrc-run
+
+NAME=telegraf
+DAEMON=/usr/bin/$NAME
+
+# /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ ebegin "Starting ${NAME}"
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile /var/run/${NAME}.pid \
+ --exec ${DAEMON} -- ${OPTS} -config /etc/${NAME}/${NAME}.conf -config-directory /etc/${NAME}/${NAME}.d
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${NAME}"
+ start-stop-daemon --stop --quiet \
+ --exec ${DAEMON} \
+ --pidfile /var/run/${NAME}.pid \
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${NAME}"
+ if ! service_started "${NAME}" ; then
+ eend 1 "${NAME} is not started"
+ return 1
+ fi
+ start-stop-daemon --stop --oknodo --signal HUP \
+ --exec ${DAEMON} --pidfile /var/run/${NAME}.pid
+ eend $?
+}
+