From 3609b20fb2ca3e9ae7cf636822a75524f99466b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Urmin=C4=8Dek?= Date: Mon, 16 Oct 2023 21:08:18 +0200 Subject: [PATCH] fix(bin/eqmx): do not rely on existing user name Container should be able to run as other user too. Use uid as fallback. Prerequisite to be able to run as user specified during startup. --- bin/emqx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/emqx b/bin/emqx index f24210cdf..5b61042d7 100755 --- a/bin/emqx +++ b/bin/emqx @@ -48,7 +48,7 @@ RUNNER_SCRIPT="$RUNNER_BIN_DIR/$REL_NAME" CODE_LOADING_MODE="${CODE_LOADING_MODE:-embedded}" REL_DIR="$RUNNER_ROOT_DIR/releases/$REL_VSN" -WHOAMI=$(whoami) +WHOAMI=$(whoami 2>/dev/null || id -u) # hocon try to read environment variables starting with "EMQX_" export HOCON_ENV_OVERRIDE_PREFIX='EMQX_'