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-23 17:08:53 +0000 |
commit | 137150c6df109ae94f6662252585f09461a9c488 (patch) | |
tree | 836cc0c2f0ada3b33dc81c26bac3cd571a3fd0f3 /meta/recipes-core/systemd/systemd | |
parent | b5e634644b69a968a93aad0dd0502cf479d3973a (diff) | |
download | poky-137150c6df109ae94f6662252585f09461a9c488.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: 2e0259931f71701147039bb8e60251892f67dbcd)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch | 39 |
1 files changed, 39 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 | |||