diff --git a/cmd/zpool_influxdb/Makefile.am b/cmd/zpool_influxdb/Makefile.am index d87afc48f8b6..110eab52bdfa 100644 --- a/cmd/zpool_influxdb/Makefile.am +++ b/cmd/zpool_influxdb/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/config/Rules.am -bin_PROGRAMS = zpool_influxdb +libexec_PROGRAMS = zpool_influxdb zpool_influxdb_SOURCES = \ zpool_influxdb.c diff --git a/cmd/zpool_influxdb/README.md b/cmd/zpool_influxdb/README.md index 7d6c253d7d79..d4a4abfd1f8f 100644 --- a/cmd/zpool_influxdb/README.md +++ b/cmd/zpool_influxdb/README.md @@ -237,7 +237,7 @@ be restarted to read the config-directory files. # # Read metrics from zpool_influxdb [[inputs.execd]] # ## default installation location for zpool_influxdb command - command = ["/usr/bin/zpool_influxdb", "--execd"] + command = ["/usr/libexec/zpool_influxdb", "--execd"] ## Define how the process is signaled on each collection interval. ## Valid values are: @@ -264,7 +264,7 @@ be restarted to read the config-directory files. # # Read metrics from zpool_influxdb [[inputs.exec]] # ## default installation location for zpool_influxdb command - commands = ["/usr/bin/zpool_influxdb"] + commands = ["/usr/libexec/zpool_influxdb"] data_format = "influx" ``` diff --git a/cmd/zpool_influxdb/telegraf.d/exec_zpool_influxdb.conf b/cmd/zpool_influxdb/telegraf.d/exec_zpool_influxdb.conf index e934b4e88509..f0fb040d3c83 100644 --- a/cmd/zpool_influxdb/telegraf.d/exec_zpool_influxdb.conf +++ b/cmd/zpool_influxdb/telegraf.d/exec_zpool_influxdb.conf @@ -1,7 +1,7 @@ # # Read metrics from zpool_influxdb [[inputs.exec]] # ## default installation location for zpool_influxdb command - commands = ["/usr/local/bin/zpool_influxdb"] + commands = ["/usr/local/libexec/zpool_influxdb"] # ## Timeout for each command to complete. # timeout = "5s" # diff --git a/cmd/zpool_influxdb/telegraf.d/execd_zpool_influxdb.conf b/cmd/zpool_influxdb/telegraf.d/execd_zpool_influxdb.conf index e56c51fc10d7..ffff4f820180 100644 --- a/cmd/zpool_influxdb/telegraf.d/execd_zpool_influxdb.conf +++ b/cmd/zpool_influxdb/telegraf.d/execd_zpool_influxdb.conf @@ -1,7 +1,7 @@ # # Read metrics from zpool_influxdb [[inputs.execd]] # ## default installation location for zpool_influxdb command - command = ["/usr/local/bin/zpool_influxdb", "--execd"] + command = ["/usr/local/libexec/zpool_influxdb", "--execd"] ## Define how the process is signaled on each collection interval. ## Valid values are: diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in index 0529c1619d5f..75d119c1b152 100644 --- a/rpm/generic/zfs.spec.in +++ b/rpm/generic/zfs.spec.in @@ -439,11 +439,12 @@ systemctl --system daemon-reload >/dev/null || true %{_bindir}/raidz_test %{_bindir}/zgenhostid %{_bindir}/zvol_wait -%{_bindir}/zpool_influxdb # Optional Python 2/3 scripts %{_bindir}/arc_summary %{_bindir}/arcstat %{_bindir}/dbufstat +# Auxiliary executables +%{_libexecdir}/zpool_influxdb # Man pages %{_mandir}/man1/* %{_mandir}/man5/* diff --git a/scripts/Makefile.am b/scripts/Makefile.am index af7c36c8fc51..aded57c987e5 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -61,6 +61,7 @@ export EXTRA_ENVIRONMENT all-local: -$(SED) -e '\|^export BIN_DIR=|s|$$|@abs_top_builddir@/bin|' \ -e '\|^export SBIN_DIR=|s|$$|@abs_top_builddir@/bin|' \ + -e '\|^export LIBEXEC_DIR=|s|$$|@abs_top_builddir@/bin|' \ -e '\|^export ZTS_DIR=|s|$$|@abs_top_srcdir@/tests|' \ -e '\|^export SCRIPT_DIR=|s|$$|@abs_top_srcdir@/scripts|' \ $(abs_top_srcdir)/scripts/common.sh.in >common.sh @@ -72,6 +73,7 @@ clean-local: install-data-hook: -$(SED) -e '\|^export BIN_DIR=|s|$$|@bindir@|' \ -e '\|^export SBIN_DIR=|s|$$|@sbindir@|' \ + -e '\|^export LIBEXEC_DIR=|s|$$|@libexecdir@|' \ -e '\|^export ZTS_DIR=|s|$$|@datadir@/@PACKAGE@|' \ -e '\|^export SCRIPT_DIR=|s|$$|@datadir@/@PACKAGE@|' \ $(abs_top_srcdir)/scripts/common.sh.in \ diff --git a/scripts/common.sh.in b/scripts/common.sh.in index 2d9d9c786622..f5014cb93e83 100644 --- a/scripts/common.sh.in +++ b/scripts/common.sh.in @@ -5,6 +5,7 @@ export BIN_DIR= export SBIN_DIR= export ZTS_DIR= export SCRIPT_DIR= +export LIBEXEC_DIR= # General commands export ZDB=${ZDB:-$SBIN_DIR/zdb} diff --git a/tests/zfs-tests/tests/functional/zpool_influxdb/zpool_influxdb.ksh b/tests/zfs-tests/tests/functional/zpool_influxdb/zpool_influxdb.ksh index 495a4a38b7f5..ebeeb729d6fa 100755 --- a/tests/zfs-tests/tests/functional/zpool_influxdb/zpool_influxdb.ksh +++ b/tests/zfs-tests/tests/functional/zpool_influxdb/zpool_influxdb.ksh @@ -50,7 +50,7 @@ function check_for } # by default, all stats and histograms for all pools -log_must zpool_influxdb > $tmpfile +log_must $LIBEXEC_DIR/zpool_influxdb > $tmpfile STATS=" zpool_io_size