Skip to content

Commit ecf65ce

Browse files
authored
Merge pull request #428 from aanderse/path/sysctl
2 parents cf201a4 + 0d742d6 commit ecf65ce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/procps.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#include "helpers.h"
3333
#include "plugin.h"
3434

35+
#ifndef SYSCTL_PATH
36+
#define SYSCTL_PATH "/sbin/sysctl"
37+
#endif
38+
3539
static void setup(void *arg)
3640
{
3741
glob_t gl;
@@ -54,7 +58,7 @@ static void setup(void *arg)
5458
for (i = 0; i < gl.gl_pathc; i++) {
5559
char cmd[160];
5660

57-
snprintf(cmd, sizeof(cmd), "/sbin/sysctl -e -p %s >/dev/null", gl.gl_pathv[i]);
61+
snprintf(cmd, sizeof(cmd), "%s -e -p %s >/dev/null", SYSCTL_PATH, gl.gl_pathv[i]);
5862
run(cmd, "sysctl");
5963
}
6064
globfree(&gl);

0 commit comments

Comments
 (0)