Skip to content

Instantly share code, notes, and snippets.

@oddstr13
Created September 19, 2018 21:36
Show Gist options
  • Save oddstr13/dbeb06a15e77c4b7db85a775d7398e17 to your computer and use it in GitHub Desktop.
Save oddstr13/dbeb06a15e77c4b7db85a775d7398e17 to your computer and use it in GitHub Desktop.
telegraf OpenWRT procd init script
#!/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