From 0d742d6ae8e58fce9c09e287e838706e3c57756d Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Tue, 18 Feb 2025 20:14:37 -0500 Subject: [PATCH] allow sysctl path to be configured at build time --- plugins/procps.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/procps.c b/plugins/procps.c index aeb13493..29ba7553 100644 --- a/plugins/procps.c +++ b/plugins/procps.c @@ -32,6 +32,10 @@ #include "helpers.h" #include "plugin.h" +#ifndef SYSCTL_PATH +#define SYSCTL_PATH "/sbin/sysctl" +#endif + static void setup(void *arg) { glob_t gl; @@ -54,7 +58,7 @@ static void setup(void *arg) for (i = 0; i < gl.gl_pathc; i++) { char cmd[160]; - snprintf(cmd, sizeof(cmd), "/sbin/sysctl -e -p %s >/dev/null", gl.gl_pathv[i]); + snprintf(cmd, sizeof(cmd), "%s -e -p %s >/dev/null", SYSCTL_PATH, gl.gl_pathv[i]); run(cmd, "sysctl"); } globfree(&gl);