]> err.no Git - systemd/commitdiff
Drop rcN.d runlevels from SysV services that also exist in rcS.d
authorTollef Fog Heen <tfheen@err.no>
Tue, 11 Oct 2011 18:56:40 +0000 (20:56 +0200)
committerTollef Fog Heen <tfheen@err.no>
Wed, 12 Oct 2011 04:56:37 +0000 (06:56 +0200)
Fixes Debian bug #637037

debian/changelog
src/service.c

index 79cdf6ba64bd20608cb09306f70055e148561a10..40aa412bdc1b9d5a2a587530ad34461054ffca31 100644 (file)
@@ -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
 
index c2053ce3ac45e8d829bc232e28c52e4e61f748a2..d4c460ac28d3ea16c7a9ddb88c9f06366b3d0c62 100644 (file)
@@ -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