]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: raise the log priority if sd-executor is missing
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 22 Jan 2024 13:15:31 +0000 (14:15 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 22 Jan 2024 21:58:41 +0000 (21:58 +0000)
Log about missing executor at the emergency level, so the message always
makes it to the console - otherwise it won't get anywhere, since we
can't even start systemd-journald in that case.

Before:

Welcome to Arch Linux!

[    5.202479] systemd[1]: Failed to allocate manager object: No such file or directory
[!!!!!!] Failed to allocate manager object.
[    5.207741] systemd[1]: Freezing execution.

After:

Welcome to Arch Linux!

[    5.279408] systemd[1]: Failed to open executor binary '/usr/lib/systemd/systemd-executor': No such file or directory
[    5.290756] systemd[1]: Failed to allocate manager object: No such file or directory
[!!!!!!] Failed to allocate manager object.
[    5.295919] systemd[1]: Freezing execution.

src/core/manager.c

index e052e36cee65f0c6bfb97361509f4e7e5fb38220..462baab36a6f085bf5c0180eb7d7d15f79bbb104 100644 (file)
@@ -1016,9 +1016,9 @@ int manager_new(RuntimeScope runtime_scope, ManagerTestRunFlags test_run_flags,
 
                 m->executor_fd = open(SYSTEMD_EXECUTOR_BINARY_PATH, O_CLOEXEC|O_PATH);
                 if (m->executor_fd < 0)
-                        return log_warning_errno(errno,
-                                                 "Failed to open executor binary '%s': %m",
-                                                 SYSTEMD_EXECUTOR_BINARY_PATH);
+                        return log_emergency_errno(errno,
+                                                   "Failed to open executor binary '%s': %m",
+                                                   SYSTEMD_EXECUTOR_BINARY_PATH);
         } else if (!FLAGS_SET(test_run_flags, MANAGER_TEST_DONT_OPEN_EXECUTOR)) {
                 _cleanup_free_ char *self_exe = NULL, *executor_path = NULL;
                 _cleanup_close_ int self_dir_fd = -EBADF;