From: Tollef Fog Heen Date: Tue, 11 Oct 2011 18:56:40 +0000 (+0200) Subject: Drop rcN.d runlevels from SysV services that also exist in rcS.d X-Git-Tag: 37-1~6 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9870b64840a6731a3511ec26d1016faa0c60f7c9;p=systemd Drop rcN.d runlevels from SysV services that also exist in rcS.d Fixes Debian bug #637037 --- diff --git a/debian/changelog b/debian/changelog index 79cdf6ba..40aa412b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ systemd (36-2) unstable; urgency=low * Add ConditionPathIsDirectory to lib-init-rw.automount and lib-init-rw.mount so we only activate the unit if the directory 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 Wed, 28 Sep 2011 20:04:13 +0200 diff --git a/src/service.c b/src/service.c index c2053ce3..d4c460ac 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