From 183e80936d8541e457a169d6c511099e78e24c85 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 29 Jul 2025 16:37:55 +0200 Subject: [PATCH] MT#56004 functions: Add a fallback value for NGCPCFG_PID This variable is assumed to be set and exported by ngcpcfg when it starts running. But we have code (in the ngcp-upgrade steps), which calls the restore-permissions helper directly w/o going through ngcpcfg, and which then breaks when the variable is not yet set. Add a fallback value so that we do not fail anymore. But we should eventually expose this functionality as an actual command as part of the public ngcpcfg CLI. Change-Id: Ibda18faaff8a26a04240e6ed7a46ee7650b82954 --- functions/logs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/logs b/functions/logs index 85356f0e..46281b3f 100644 --- a/functions/logs +++ b/functions/logs @@ -24,7 +24,10 @@ console_output() { ## logging functions {{{ log_only() { - logger -t ngcpcfg --id="${NGCPCFG_PID}" -- "$*" + # XXX: The NGCPCFG_PID variable should be set by ngcpcfg, but we currently + # have code that executes helpers directly, where we should have exposed + # those helpers as new commands. For now we fallback to the current PID. + logger -t ngcpcfg --id="${NGCPCFG_PID:-$$}" -- "$*" } log_info() {