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
|
|
|
|
|
|
|
---
|
2013-04-13 13:09:53 +02:00
|
|
|
src/systemctl/systemctl.c | 20 ++++++++++++++++++++
|
2012-08-25 23:03:07 +02:00
|
|
|
1 file changed, 20 insertions(+)
|
|
|
|
|
2013-04-13 13:09:53 +02:00
|
|
|
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
|
|
|
index edd136a..36918f2 100644
|
|
|
|
--- a/src/systemctl/systemctl.c
|
|
|
|
+++ b/src/systemctl/systemctl.c
|
|
|
|
@@ -3642,7 +3642,27 @@ static int enable_sysv_units(char **args) {
|
2012-08-25 23:03:07 +02:00
|
|
|
|
|
|
|
if (!found_sysv) {
|
|
|
|
free(p);
|
2013-04-13 13:09:53 +02:00
|
|
|
+#ifdef HAVE_SYSV_COMPAT
|
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);
|
|
|
|
+ if (!p) {
|
|
|
|
+ log_error("No memory");
|
|
|
|
+ r = -ENOMEM;
|
|
|
|
+ goto finish;
|
|
|
|
+ }
|
|
|
|
+ p[strlen(p) - sizeof(".service") + 1] = 0;
|
|
|
|
+ found_sysv = access(p, F_OK) >= 0;
|
|
|
|
+
|
|
|
|
+ if (!found_sysv) {
|
|
|
|
+ free(p);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+#else
|
|
|
|
continue;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Mark this entry, so that we don't try enabling it as native unit */
|