summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2011-10-17 21:00:42 +0200
committerTollef Fog Heen <tfheen@err.no>2011-10-17 21:02:42 +0200
commite51db373c242b7541794affb2b5e411bcce26d0f (patch)
tree61d83176e8e7370539b3ac56274bfa016e8690e5 /src
parent563ba9ea6e60774086555998b957edf923e24b46 (diff)
service: Drop rcN.d runlevels from SysV services that also exist in rcS.d
Services which claim to start in both rcN.d and rcS.d generate loops which for some reason seems to usually end up with dbus not starting and the whole machine being quite unhappy. We now rather assume that if a service can be started in rcS, it should not also start in rcN.d. Fixes Debian bug #637037
Diffstat (limited to 'src')
-rw-r--r--src/service.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index e64d289fed..6184390659 100644
--- a/src/service.c
+++ b/src/service.c
@@ -83,7 +83,7 @@ static const struct {
#define RUNLEVELS_UP "12345"
/* #define RUNLEVELS_DOWN "06" */
-/* #define RUNLEVELS_BOOT "bBsS" */
+#define RUNLEVELS_BOOT "bBsS"
#endif
static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
@@ -811,6 +811,13 @@ static int service_load_sysv_path(Service *s, const char *path) {
if ((r = sysv_exec_commands(s)) < 0)
goto finish;
+ if (s->sysv_runlevels &&
+ chars_intersect(RUNLEVELS_BOOT, s->sysv_runlevels) &&
+ chars_intersect(RUNLEVELS_UP, s->sysv_runlevels)) {
+ /* Service has both boot and "up" runlevels
+ configured. Kill the "up" ones. */
+ delete_chars(s->sysv_runlevels, RUNLEVELS_UP);
+ }
if (s->sysv_runlevels && !chars_intersect(RUNLEVELS_UP, s->sysv_runlevels)) {
/* If there a runlevels configured for this service