telegraf: Move config file to /etc/telegraf.conf because
authorJonathan Pagel <jonny_tischbein@systemli.org>
Sun, 31 Oct 2021 16:43:25 +0000 (17:43 +0100)
committerNick Hainke <vincent@systemli.org>
Mon, 1 Nov 2021 11:04:36 +0000 (12:04 +0100)
/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>
utils/telegraf/Makefile
utils/telegraf/files/etc/init.d/telegraf

index b0c224946c2ac6145aa998c6bcacc6fbdb35dc36..53a81ec5e1a93e016f7870ea950401ca71b3aa82 100644 (file)
@@ -59,6 +59,12 @@ define Package/telegraf-full/description
        (Full build. including all plugins)
 endef
 
+define Package/telegraf/conffiles
+/etc/telegraf.conf
+endef
+
+Package/telegraf-full/conffiles = $(Package/telegraf/conffiles)
+
 define Build/Prepare
        $(call Build/Prepare/Default)
 ifeq ($(BUILD_VARIANT),small)
@@ -70,7 +76,7 @@ define Package/telegraf/install
        $(call GoPackage/Package/Install/Bin,$(1))
        $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config
        $(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
 
 define Package/telegraf-full/install
index 9faef6611efcfe6e50cbf08683c5ee53e05c3b08..dd1c8a1f5e281a8d0858b2348e66967fe6b68732 100755 (executable)
@@ -7,7 +7,7 @@ STOP=01
 
 start_service() {
     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 stderr 1
     procd_close_instance