From 9e499ed04f35bfe901b8efb19d7c830e724fff5d Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Tue, 19 May 2026 09:36:44 +0200 Subject: [PATCH] Suppressed spurious validation error log on SIGTERM When a daemon aborts cf-promises during shutdown, ShellCommandReturnsZero() returns false. Skip the "Policy failed validation" error log in that case so it doesn't pollute daemon output (and fail valgrind CI). Ticket: ENT-13720 Signed-off-by: Lars Erik Wik --- libpromises/generic_agent.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libpromises/generic_agent.c b/libpromises/generic_agent.c index 1e67f53f8d..eadb188d2c 100644 --- a/libpromises/generic_agent.c +++ b/libpromises/generic_agent.c @@ -1484,7 +1484,15 @@ bool GenericAgentArePromisesValid(const GenericAgentConfig *config) if (!ShellCommandReturnsZero(cmd, true)) { - Log(LOG_LEVEL_ERR, "Policy failed validation with command '%s'", cmd); + if (IsPendingTermination()) + { + Log(LOG_LEVEL_VERBOSE, + "Policy validation aborted due to termination signal"); + } + else + { + Log(LOG_LEVEL_ERR, "Policy failed validation with command '%s'", cmd); + } return false; }