From: Michael Tremer Date: Tue, 24 Feb 2026 15:21:48 +0000 (+0000) Subject: configure: Allow to specify the daemon user X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3dffb075fa030e0980a1e65475a591705fa955a;p=telemetry.git configure: Allow to specify the daemon user Signed-off-by: Michael Tremer --- diff --git a/configure.ac b/configure.ac index f432667..423d5c9 100644 --- a/configure.ac +++ b/configure.ac @@ -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], diff --git a/src/daemon/main.c b/src/daemon/main.c index 70270da..bd645cf 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -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;