Commit 9870b648 authored by Tollef Fog Heen's avatar Tollef Fog Heen
Browse files

Drop rcN.d runlevels from SysV services that also exist in rcS.d

Fixes Debian bug #637037
parent 263797dc
...@@ -5,6 +5,8 @@ systemd (36-2) unstable; urgency=low ...@@ -5,6 +5,8 @@ systemd (36-2) unstable; urgency=low
* Add ConditionPathIsDirectory to lib-init-rw.automount and * Add ConditionPathIsDirectory to lib-init-rw.automount and
lib-init-rw.mount so we only activate the unit if the directory lib-init-rw.mount so we only activate the unit if the directory
exists. Closes: #633059 exists. Closes: #633059
* If a sysv service exists in both rcS and rcN.d runlevels, drop the
rcN.d ones to avoid loops. Closes: #637037
-- Tollef Fog Heen <tfheen@debian.org> Wed, 28 Sep 2011 20:04:13 +0200 -- Tollef Fog Heen <tfheen@debian.org> Wed, 28 Sep 2011 20:04:13 +0200
......
...@@ -83,7 +83,7 @@ static const struct { ...@@ -83,7 +83,7 @@ static const struct {
#define RUNLEVELS_UP "12345" #define RUNLEVELS_UP "12345"
/* #define RUNLEVELS_DOWN "06" */ /* #define RUNLEVELS_DOWN "06" */
/* #define RUNLEVELS_BOOT "bBsS" */ #define RUNLEVELS_BOOT "bBsS"
#endif #endif
static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = { static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
...@@ -811,6 +811,13 @@ static int service_load_sysv_path(Service *s, const char *path) { ...@@ -811,6 +811,13 @@ static int service_load_sysv_path(Service *s, const char *path) {
if ((r = sysv_exec_commands(s)) < 0) if ((r = sysv_exec_commands(s)) < 0)
goto finish; 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 (s->sysv_runlevels && !chars_intersect(RUNLEVELS_UP, s->sysv_runlevels)) {
/* If there a runlevels configured for this service /* If there a runlevels configured for this service
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment