]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: fix finding systemd-journal-remote binary 32739/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 May 2024 02:36:24 +0000 (11:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 May 2024 02:37:24 +0000 (11:37 +0900)
Follow-up for 258d26940fb6bfa1b5b8acf03cc4a37f2657e4ac.

Fixes https://github.com/systemd/systemd/pull/31218#discussion_r1596168449.

src/vmspawn/vmspawn.c

index a5666459a34dab1289eb6b5102114add62fab554..4a6ef759a5725531bdb80d6818793fdd122c2b79 100644 (file)
@@ -1923,7 +1923,15 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
 
         if (arg_forward_journal) {
                 _cleanup_free_ char *sd_journal_remote = NULL, *listen_address = NULL, *cred = NULL;
-                r = find_executable("systemd-journal-remote", &sd_journal_remote);
+
+                r = find_executable_full(
+                                "systemd-journal-remote",
+                                /* root = */ NULL,
+                                STRV_MAKE(LIBEXECDIR),
+                                /* use_path_envvar = */ true, /* systemd-journal-remote should be installed in
+                                                               * LIBEXECDIR, but for supporting fancy setups. */
+                                &sd_journal_remote,
+                                /* ret_fd = */ NULL);
                 if (r < 0)
                         return log_error_errno(r, "Failed to find systemd-journal-remote binary: %m");