diff options
| author | Mingli Yu <mingli.yu@windriver.com> | 2021-01-21 15:44:49 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-21 23:25:53 +0000 |
| commit | 4461ba4f5d629d515530e5e1dc9aba6b98505ff9 (patch) | |
| tree | 2cc43cffdc037428b6ccbbf91fae5f40783c1236 /meta | |
| parent | ebfeb3d7b070ed5147e2f6f46597cd02463fbee3 (diff) | |
| download | poky-4461ba4f5d629d515530e5e1dc9aba6b98505ff9.tar.gz | |
systemd: resolve executable path if it is relative
Backport a patch to fix the below systemd-analyze issue:
# systemd-analyze --man=false verify /lib/systemd/system/initrd-cleanup.service
initrd-cleanup.service: Command systemctl is not executable: No such file or directory
# which systemctl
/bin/systemctl
# cat /lib/systemd/system/initrd-cleanup.service
[snip]
[Unit]
Description=Cleaning Up and Shutting Down Daemons
DefaultDependencies=no
AssertPathExists=/etc/initrd-release
OnFailure=emergency.target
OnFailureJobMode=replace-irreversibly
After=initrd-root-fs.target initrd-fs.target initrd.target
[Service]
Type=oneshot
ExecStart=systemctl --no-block isolate initrd-switch-root.target
(From OE-Core rev: aa4d56fc5f7d772df86220f44fe15f7689a3093a)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch | 39 | ||||
| -rw-r--r-- | meta/recipes-core/systemd/systemd_247.2.bb | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch b/meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch new file mode 100644 index 0000000000..fd7f94a61d --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From b9b7a8e3825f0433e120f7a6d7d5d635a839cab9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
| 3 | Date: Thu, 21 Jan 2021 06:19:44 +0000 | ||
| 4 | Subject: [PATCH] analyze: resolve executable path if it is relative | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/systemd/systemd/commit/f1fb046a985521f7d4a662f02546686ff20b7e5d] | ||
| 7 | |||
| 8 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
| 9 | --- | ||
| 10 | src/analyze/analyze-verify.c | 7 +++++-- | ||
| 11 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/src/analyze/analyze-verify.c b/src/analyze/analyze-verify.c | ||
| 14 | index a9c89173bf..969523df18 100644 | ||
| 15 | --- a/src/analyze/analyze-verify.c | ||
| 16 | +++ b/src/analyze/analyze-verify.c | ||
| 17 | @@ -115,14 +115,17 @@ static int verify_socket(Unit *u) { | ||
| 18 | } | ||
| 19 | |||
| 20 | int verify_executable(Unit *u, const ExecCommand *exec) { | ||
| 21 | + int r; | ||
| 22 | + | ||
| 23 | if (!exec) | ||
| 24 | return 0; | ||
| 25 | |||
| 26 | if (exec->flags & EXEC_COMMAND_IGNORE_FAILURE) | ||
| 27 | return 0; | ||
| 28 | |||
| 29 | - if (access(exec->path, X_OK) < 0) | ||
| 30 | - return log_unit_error_errno(u, errno, "Command %s is not executable: %m", exec->path); | ||
| 31 | + r = find_executable_full(exec->path, false, NULL); | ||
| 32 | + if (r < 0) | ||
| 33 | + return log_unit_error_errno(u, r, "Command %s is not executable: %m", exec->path); | ||
| 34 | |||
| 35 | return 0; | ||
| 36 | } | ||
| 37 | -- | ||
| 38 | 2.26.2 | ||
| 39 | |||
diff --git a/meta/recipes-core/systemd/systemd_247.2.bb b/meta/recipes-core/systemd/systemd_247.2.bb index 84d997196c..7ddcb169c3 100644 --- a/meta/recipes-core/systemd/systemd_247.2.bb +++ b/meta/recipes-core/systemd/systemd_247.2.bb | |||
| @@ -24,6 +24,7 @@ SRC_URI += "file://touchscreen.rules \ | |||
| 24 | file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \ | 24 | file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \ |
| 25 | file://0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch \ | 25 | file://0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch \ |
| 26 | file://0027-proc-dont-trigger-mount-error-with-invalid-options-o.patch \ | 26 | file://0027-proc-dont-trigger-mount-error-with-invalid-options-o.patch \ |
| 27 | file://0001-analyze-resolve-executable-path-if-it-is-relative.patch \ | ||
| 27 | " | 28 | " |
| 28 | 29 | ||
| 29 | # patches needed by musl | 30 | # patches needed by musl |
