From 164fedd48b24e885cc5acd3461ba66b1161c2a3f 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 (cherry picked from commit 9e499ed04f35bfe901b8efb19d7c830e724fff5d) --- 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 4b4b132fa7..c8da79370c 100644 --- a/libpromises/generic_agent.c +++ b/libpromises/generic_agent.c @@ -1470,7 +1470,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; }