summaryrefslogtreecommitdiff
path: root/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-23 23:36:52 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-23 23:36:52 +0200
commita0fcc5f6ce46ae69649f42e844249c54aa1e7b2e (patch)
treeb021c2a4f67cfd16ebb70e995084bf6211ff941c /service.c
parent8d025b231b97da7b5cf908309f23e5af78bae4a4 (diff)
service: make sure sysv services keep a ref on shutdown.target so that it doesn't get GC'd
Diffstat (limited to 'service.c')
-rw-r--r--service.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/service.c b/service.c
index 84077a19f1..42ce3dcbd7 100644
--- a/service.c
+++ b/service.c
@@ -2253,7 +2253,7 @@ static int service_enumerate(Manager *m) {
if ((r = unit_add_dependency(runlevel_target, UNIT_WANTS, service, true)) < 0)
goto finish;
- if ((r = unit_add_dependency(runlevel_target, UNIT_AFTER, service, true)) < 0)
+ if ((r = unit_add_dependency(service, UNIT_BEFORE, runlevel_target, true)) < 0)
goto finish;
} else if (de->d_name[0] == 'K' &&
@@ -2276,10 +2276,10 @@ static int service_enumerate(Manager *m) {
if ((r = manager_load_unit(m, SPECIAL_SHUTDOWN_TARGET, NULL, &shutdown_target)) < 0)
goto finish;
- if ((r = unit_add_dependency(shutdown_target, UNIT_CONFLICTS, service, true)) < 0)
+ if ((r = unit_add_dependency(service, UNIT_CONFLICTS, shutdown_target, true)) < 0)
goto finish;
- if ((r = unit_add_dependency(shutdown_target, UNIT_BEFORE, service, true)) < 0)
+ if ((r = unit_add_dependency(service, UNIT_BEFORE, shutdown_target, true)) < 0)
goto finish;
}
}