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],
// 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;