2011-09-30 17:58:39 +02:00
|
|
|
From 6620bceb7233a830be3635a4f7a7dc75c13a9c8e Mon Sep 17 00:00:00 2001
|
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Fri, 30 Sep 2011 14:12:45 +0200
|
|
|
|
Subject: [PATCH] service: Fix dependencies added when parsing insserv.conf
|
|
|
|
|
|
|
|
---
|
|
|
|
src/service.c | 16 +++++++++-------
|
|
|
|
1 files changed, 9 insertions(+), 7 deletions(-)
|
|
|
|
|
2012-01-18 17:44:20 +01:00
|
|
|
Index: systemd-37/src/service.c
|
|
|
|
===================================================================
|
|
|
|
--- systemd-37.orig/src/service.c
|
|
|
|
+++ systemd-37/src/service.c
|
|
|
|
@@ -3028,22 +3028,23 @@ static void sysv_facility_in_insserv_con
|
|
|
|
if (sysv_translate_facility(parsed[0], NULL, &facility) < 0)
|
|
|
|
continue;
|
|
|
|
if ((u = manager_get_unit(mgr, facility)) && (u->meta.type == UNIT_TARGET)) {
|
|
|
|
- UnitDependency e;
|
2011-09-30 17:58:39 +02:00
|
|
|
char *dep = NULL, *name, **j;
|
|
|
|
|
|
|
|
STRV_FOREACH (j, parsed+1) {
|
|
|
|
- if (*j[0]=='+') {
|
|
|
|
- e = UNIT_WANTS;
|
|
|
|
+ if (*j[0]=='+')
|
|
|
|
name = *j+1;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- e = UNIT_REQUIRES;
|
|
|
|
+ else
|
|
|
|
name = *j;
|
|
|
|
- }
|
|
|
|
+ if (streq(name, "boot.localfs") ||
|
|
|
|
+ streq(name, "boot.crypto"))
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
if (sysv_translate_facility(name, NULL, &dep) < 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
- r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, e, dep, NULL, true);
|
|
|
|
+ r = unit_add_dependency_by_name_inverse(u, UNIT_BEFORE, dep, NULL, true);
|
|
|
|
+ if (*j[0]!='+')
|
|
|
|
+ r = unit_add_dependency_by_name(u, UNIT_REQUIRES, dep, NULL, true);
|
|
|
|
free(dep);
|
|
|
|
}
|
|
|
|
}
|