telegraf: Move config file to /etc/telegraf.conf because
/etc/config is the default uci folder. Also marking it as configuration file prevents overwriting it on updates. Signed-off-by: Jonathan Pagel <jonny_tischbein@systemli.org> (cherry picked from commit abb33331e532b1de40adea6553589770b3e9ddb9) Signed-off-by: Jonathan Pagel <jonny_tischbein@systemli.org>
This commit is contained in:
parent
989aecf2bb
commit
82c35fa92f
2 changed files with 8 additions and 2 deletions
|
@ -59,6 +59,12 @@ define Package/telegraf-full/description
|
||||||
(Full build. including all plugins)
|
(Full build. including all plugins)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/telegraf/conffiles
|
||||||
|
/etc/telegraf.conf
|
||||||
|
endef
|
||||||
|
|
||||||
|
Package/telegraf-full/conffiles = $(Package/telegraf/conffiles)
|
||||||
|
|
||||||
define Build/Prepare
|
define Build/Prepare
|
||||||
$(call Build/Prepare/Default)
|
$(call Build/Prepare/Default)
|
||||||
ifeq ($(BUILD_VARIANT),small)
|
ifeq ($(BUILD_VARIANT),small)
|
||||||
|
@ -70,7 +76,7 @@ define Package/telegraf/install
|
||||||
$(call GoPackage/Package/Install/Bin,$(1))
|
$(call GoPackage/Package/Install/Bin,$(1))
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config
|
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config
|
||||||
$(INSTALL_BIN) ./files/etc/init.d/telegraf $(1)/etc/init.d/telegraf
|
$(INSTALL_BIN) ./files/etc/init.d/telegraf $(1)/etc/init.d/telegraf
|
||||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/telegraf.conf $(1)/etc/config/telegraf.conf
|
$(INSTALL_CONF) $(PKG_BUILD_DIR)/etc/telegraf.conf $(1)/etc/telegraf.conf
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/telegraf-full/install
|
define Package/telegraf-full/install
|
||||||
|
|
|
@ -7,7 +7,7 @@ STOP=01
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command /usr/bin/telegraf --config /etc/config/telegraf.conf
|
procd_set_param command /usr/bin/telegraf --config /etc/telegraf.conf
|
||||||
procd_set_param stdout 1
|
procd_set_param stdout 1
|
||||||
procd_set_param stderr 1
|
procd_set_param stderr 1
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
|
|
Loading…
Reference in a new issue