summaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-05 19:46:31 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-05 19:50:03 +0200
commiteeaafddcb5ce492f2b3d53678820d41a04ab66b2 (patch)
treedba8a84e7011cdd14731e0615e4dc3d4cf94f6ac /src/service.c
parenta042efad57741e90ee78b69c57310858295bf3fc (diff)
service: always sort services from suse B runlevel before services from normal runlevels
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index 7fb3db3410..b2e0f86ae8 100644
--- a/src/service.c
+++ b/src/service.c
@@ -292,6 +292,7 @@ static int sysv_fix_order(Service *s) {
LIST_FOREACH(units_per_type, other, s->meta.manager->units_per_type[UNIT_SERVICE]) {
Service *t;
UnitDependency d;
+ bool special_s, special_t;
t = (Service*) other;
@@ -307,7 +308,14 @@ static int sysv_fix_order(Service *s) {
(!t->sysv_path || t->sysv_has_lsb))
continue;
- if (t->sysv_start_priority < s->sysv_start_priority)
+ special_s = s->sysv_runlevels && !chars_intersect(RUNLEVELS_UP, s->sysv_runlevels);
+ special_t = t->sysv_runlevels && !chars_intersect(RUNLEVELS_UP, t->sysv_runlevels);
+
+ if (special_t && !special_s)
+ d = UNIT_AFTER;
+ else if (special_s && !special_t)
+ d = UNIT_BEFORE;
+ else if (t->sysv_start_priority < s->sysv_start_priority)
d = UNIT_AFTER;
else if (t->sysv_start_priority > s->sysv_start_priority)
d = UNIT_BEFORE;