0001-systemctl-Call-systemd-sysv-install-without-path.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 34c8551a8b16bf235a1ebe8d9cb1a3474a7c975e Mon Sep 17 00:00:00 2001
  2. From: Peter Kjellerstedt <pkj@axis.com>
  3. Date: Fri, 22 Aug 2025 18:07:28 +0200
  4. Subject: [PATCH] systemctl: Call systemd-sysv-install without path
  5. Expect to find systemd-sysv-install in $PATH instead of hardcoding the
  6. path to it, as the latter does not work when running systemctl from a
  7. recipe sysroot.
  8. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
  9. Upstream-Status: Inappropriate [OE specific]
  10. ---
  11. src/systemctl/systemctl-sysv-compat.c | 4 ++--
  12. 1 file changed, 2 insertions(+), 2 deletions(-)
  13. diff --git a/src/systemctl/systemctl-sysv-compat.c b/src/systemctl/systemctl-sysv-compat.c
  14. index cb9c43e3dc..e44ef9f64e 100644
  15. --- a/src/systemctl/systemctl-sysv-compat.c
  16. +++ b/src/systemctl/systemctl-sysv-compat.c
  17. @@ -140,7 +140,7 @@ int enable_sysv_units(const char *verb, char **args) {
  18. while (args[f]) {
  19. const char *argv[] = {
  20. - LIBEXECDIR "/systemd-sysv-install",
  21. + "systemd-sysv-install",
  22. NULL, /* --root= */
  23. NULL, /* verb */
  24. NULL, /* service */
  25. @@ -218,7 +218,7 @@ int enable_sysv_units(const char *verb, char **args) {
  26. return j;
  27. if (j == 0) {
  28. /* Child */
  29. - execv(argv[0], (char**) argv);
  30. + execvp(argv[0], (char**) argv);
  31. log_error_errno(errno, "Failed to execute %s: %m", argv[0]);
  32. _exit(EXIT_FAILURE);
  33. }