summaryrefslogtreecommitdiff
path: root/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-07 20:28:44 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-07 20:28:44 +0200
commit0bc824be78848cdf12f19aff4144666dc4114858 (patch)
tree6493427498e1f37ed88fbc2d038ebbc5cd331c9f /service.c
parent8309400a17b041fb8b52b13b9125eb65d11f3669 (diff)
sysv: add basic.target dependencies only for normal init scripts
Diffstat (limited to 'service.c')
-rw-r--r--service.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/service.c b/service.c
index c5e3bc13b4..8a0034936f 100644
--- a/service.c
+++ b/service.c
@@ -592,9 +592,17 @@ static int service_load_sysv_path(Service *s, const char *path, UnitLoadState *n
if ((r = sysv_exec_commands(s)) < 0)
goto finish;
- if ((r = unit_add_dependency_by_name(u, UNIT_REQUIRES, SPECIAL_BASIC_TARGET)) < 0 ||
- (r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_BASIC_TARGET)) < 0)
- goto finish;
+ if (!s->sysv_runlevels || chars_intersect("12345", s->sysv_runlevels)) {
+ /* If there a runlevels configured for this service
+ * but none of the standard ones, then we assume this
+ * is some special kind of service (which might be
+ * needed for early boot) and don't create any links
+ * to it. */
+
+ if ((r = unit_add_dependency_by_name(u, UNIT_REQUIRES, SPECIAL_BASIC_TARGET)) < 0 ||
+ (r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_BASIC_TARGET)) < 0)
+ goto finish;
+ }
*new_state = UNIT_LOADED;
r = 0;