Created
September 19, 2018 21:36
-
-
Save oddstr13/dbeb06a15e77c4b7db85a775d7398e17 to your computer and use it in GitHub Desktop.
telegraf OpenWRT procd init script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh /etc/rc.common | |
START=99 | |
USE_PROCD=1 | |
PROG=/usr/bin/telegraf | |
config=/etc/telegraf/telegraf.conf | |
confdir=/etc/telegraf/telegraf.d | |
start_service() { | |
procd_open_instance | |
procd_set_param command "${PROG}" --config="${config}" --config-directory="${confdir}" $TELEGRAF_OPTS | |
procd_set_param pidfile "${pidfile}" | |
procd_set_param env OPEN_FILE_LIMIT=65536 | |
procd_set_param file "${config}" | |
procd_set_param stdout 1 | |
procd_set_param stderr 1 | |
procd_close_instance | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment