From 0d5ee894c4839b8432b530879a7cda070b29e393 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 7 May 2025 17:47:01 +0200 Subject: [PATCH] exec-util: make missing agents a gracefull handled issues Just downgrade the log message in case of ENOENT of agent binaries to LOG_DEBUG. Do this in order to support distros which split off some agent bianries into separate optional binaries. Fixes: #37369 --- src/shared/exec-util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/exec-util.c b/src/shared/exec-util.c index 75f24aef985..99dc4d597cd 100644 --- a/src/shared/exec-util.c +++ b/src/shared/exec-util.c @@ -618,6 +618,10 @@ int _fork_agent(const char *name, char * const *argv, const int except[], size_t /* Count arguments */ execv(argv[0], argv); - log_error_errno(errno, "Failed to execute %s: %m", argv[0]); + + /* Let's treat missing agent binary as a graceful issue (in order to support splitting out the Polkit + * or password agents into separate, optional distro packages), and not complain loudly. */ + log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, + "Failed to execute %s: %m", argv[0]); _exit(EXIT_FAILURE); } -- 2.47.3