]> git.ipfire.org Git - telemetry.git/commitdiff
configure: Allow to specify the daemon user
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Feb 2026 15:21:48 +0000 (15:21 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Feb 2026 15:21:48 +0000 (15:21 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
configure.ac
src/daemon/main.c

index f432667d489cfe70c0b788412bf63ac3baa0cbd2..423d5c9fa629a7d9362357371739988aab8d01ad 100644 (file)
@@ -241,6 +241,20 @@ AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages],
 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
 
+
+# ------------------------------------------------------------------------------
+
+AC_ARG_WITH([user],
+       [AS_HELP_STRING([--with-user=USER],
+               [run daemon as this unprivileged user @<:@default: telemetry@:>@])],
+       [DAEMON_USER="$withval"],
+       [DAEMON_USER="telemetry"])
+
+AC_SUBST([DAEMON_USER])
+
+AC_DEFINE_UNQUOTED([DAEMON_USER], ["$DAEMON_USER"],
+       [Unprivileged user the daemon runs as])
+
 # ------------------------------------------------------------------------------
 
 AC_ARG_ENABLE([tests],
index 70270daf5026bf08d1d0536118591da4da0190d6..bd645cfb83a66ec0c4e009b686182df5cd0ee3e3 100644 (file)
@@ -50,7 +50,7 @@ static struct argp_option options[] = {
 // Collect all sources that should be enabled
 static char** sources = NULL;
 
-static const char* user = "nobody";
+static const char* user = DAEMON_USER;
 
 static error_t parse(int key, char* arg, struct argp_state* state) {
        td_ctx* ctx = state->input;