summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2011-10-11 20:56:40 +0200
committerTollef Fog Heen <tfheen@err.no>2011-10-12 06:56:37 +0200
commit9870b64840a6731a3511ec26d1016faa0c60f7c9 (patch)
tree91e3daa068b2a4415fcba6b48bacc2dca96550e3
parent263797dc0b4849a2bdd16c8575165b78bb375c88 (diff)
downloadsystemd-9870b64840a6731a3511ec26d1016faa0c60f7c9.tar.gz
Drop rcN.d runlevels from SysV services that also exist in rcS.d
Fixes Debian bug #637037
-rw-r--r--debian/changelog2
-rw-r--r--src/service.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 79cdf6ba64..40aa412bdc 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 <tfheen@debian.org> Wed, 28 Sep 2011 20:04:13 +0200
diff --git a/src/service.c b/src/service.c
index c2053ce3ac..d4c460ac28 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