2012-08-25 23:03:07 +02:00
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Thu, 23 Aug 2012 11:08:25 +0200
|
2013-04-13 13:09:53 +02:00
|
|
|
Subject: fix support for boot prefixed initscript (bnc#746506)
|
2012-08-25 23:03:07 +02:00
|
|
|
|
|
|
|
---
|
2015-06-23 14:56:50 +02:00
|
|
|
src/systemctl/systemctl.c | 18 +++++++++++++++++-
|
|
|
|
1 file changed, 17 insertions(+), 1 deletion(-)
|
2012-08-25 23:03:07 +02:00
|
|
|
|
2015-06-23 14:56:50 +02:00
|
|
|
Index: systemd-221/src/systemctl/systemctl.c
|
2015-02-13 10:43:21 +01:00
|
|
|
===================================================================
|
2015-06-23 14:56:50 +02:00
|
|
|
--- systemd-221.orig/src/systemctl/systemctl.c
|
|
|
|
+++ systemd-221/src/systemctl/systemctl.c
|
|
|
|
@@ -5165,8 +5165,24 @@ static int enable_sysv_units(const char
|
2012-08-25 23:03:07 +02:00
|
|
|
|
2015-02-13 10:43:21 +01:00
|
|
|
p[strlen(p) - strlen(".service")] = 0;
|
|
|
|
found_sysv = access(p, F_OK) >= 0;
|
2013-04-19 22:31:17 +02:00
|
|
|
- if (!found_sysv)
|
|
|
|
+ if (!found_sysv) {
|
2013-04-13 13:09:53 +02:00
|
|
|
+#ifdef HAVE_SYSV_COMPAT
|
2013-04-19 22:31:17 +02:00
|
|
|
+ free(p);
|
2012-08-25 23:03:07 +02:00
|
|
|
+ p = NULL;
|
|
|
|
+ if (!isempty(arg_root))
|
|
|
|
+ asprintf(&p, "%s/" SYSTEM_SYSVINIT_PATH "/boot.%s", arg_root, name);
|
|
|
|
+ else
|
|
|
|
+ asprintf(&p, SYSTEM_SYSVINIT_PATH "/boot.%s", name);
|
2015-02-13 10:43:21 +01:00
|
|
|
+ if (!p)
|
|
|
|
+ return -ENOMEM;
|
2012-08-25 23:03:07 +02:00
|
|
|
+ p[strlen(p) - sizeof(".service") + 1] = 0;
|
|
|
|
+ found_sysv = access(p, F_OK) >= 0;
|
2015-06-23 14:56:50 +02:00
|
|
|
+ if (!found_sysv)
|
2012-08-25 23:03:07 +02:00
|
|
|
+ continue;
|
|
|
|
+#else
|
|
|
|
continue;
|
|
|
|
+#endif
|
2013-04-19 22:31:17 +02:00
|
|
|
+ }
|
2012-08-25 23:03:07 +02:00
|
|
|
|
2015-06-23 14:56:50 +02:00
|
|
|
if (found_native)
|
|
|
|
log_info("Synchronizing state of %s with SysV init with %s...", name, argv[0]);
|