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
This commit is contained in:
Lennart Poettering
2025-05-08 02:38:47 +09:00
committed by Yu Watanabe
parent ffb6adb763
commit 0d5ee894c4
+5 -1
View File
@@ -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);
}