]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
exec-util: make missing agents a gracefull handled issues
authorLennart Poettering <lennart@poettering.net>
Wed, 7 May 2025 15:47:01 +0000 (17:47 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 May 2025 17:38:47 +0000 (02:38 +0900)
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

index 75f24aef985260f0f5108875c3d3cf60278ca3f0..99dc4d597cd4fb8f91cda67e8c1bee9aba66d6a6 100644 (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);
 }