[systemd-commits] 2 commits - src/service.c units/fedora

Lennart Poettering lennart at kemper.freedesktop.org
Sun Jun 6 17:43:08 PDT 2010


 src/service.c                |   19 +++++++++++++------
 units/fedora/sysinit.service |    2 ++
 2 files changed, 15 insertions(+), 6 deletions(-)

New commits:
commit ef9b78bb031f84d4f1c9dd2255068cc2afb9d088
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 7 02:42:58 2010 +0200

    units: shut down sysinit service on shutdown

diff --git a/units/fedora/sysinit.service b/units/fedora/sysinit.service
index 1c0ce2c..5981552 100644
--- a/units/fedora/sysinit.service
+++ b/units/fedora/sysinit.service
@@ -8,6 +8,8 @@
 [Unit]
 Description=System Initialization
 Before=local-fs.target remote-fs.target swap.target sockets.target
+Conflicts=shutdown.target
+Before=shutdown.target
 
 [Service]
 ExecStart=/etc/rc.d/rc.sysinit
commit fc5df99e247b1bea9834b1e1e7b69ec6f955411e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jun 7 02:42:01 2010 +0200

    service: honour suse style Kxx links in boot.d/ directory

diff --git a/src/service.c b/src/service.c
index 8b1fab7..651f7c8 100644
--- a/src/service.c
+++ b/src/service.c
@@ -40,7 +40,7 @@
 typedef enum RunlevelType {
         RUNLEVEL_UP,
         RUNLEVEL_DOWN,
-        RUNLEVEL_BASIC
+        RUNLEVEL_SYSINIT
 } RunlevelType;
 
 static const struct {
@@ -58,10 +58,10 @@ static const struct {
         { "rc6.d",  SPECIAL_RUNLEVEL6_TARGET, RUNLEVEL_DOWN },
 
         /* SUSE style boot.d */
-        { "boot.d", SPECIAL_SYSINIT_TARGET,   RUNLEVEL_BASIC },
+        { "boot.d", SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT },
 
         /* Debian style rcS.d */
-        { "rcS.d",  SPECIAL_SYSINIT_TARGET,   RUNLEVEL_BASIC },
+        { "rcS.d",  SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT },
 };
 
 #define RUNLEVELS_UP "12345"
@@ -2268,7 +2268,7 @@ static int service_enumerate(Manager *m) {
                                 }
 
                                 if (de->d_name[0] == 'S' &&
-                                    (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_BASIC))
+                                    (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT))
                                         SERVICE(service)->sysv_start_priority =
                                                 MAX(a*10 + b, SERVICE(service)->sysv_start_priority);
 
@@ -2287,7 +2287,9 @@ static int service_enumerate(Manager *m) {
                                         if ((r = unit_add_dependency(service, UNIT_BEFORE, runlevel_target, true)) < 0)
                                                 goto finish;
 
-                                } else if (de->d_name[0] == 'K' && rcnd_table[i].type == RUNLEVEL_DOWN) {
+                                } else if (de->d_name[0] == 'K' &&
+                                           (rcnd_table[i].type == RUNLEVEL_DOWN ||
+                                            rcnd_table[i].type == RUNLEVEL_SYSINIT)) {
                                         Unit *shutdown_target;
 
                                         /* We honour K links only for
@@ -2299,7 +2301,12 @@ static int service_enumerate(Manager *m) {
                                          * really distuingish here
                                          * between the runlevels 0 and
                                          * 6 and just add them to the
-                                         * special shutdown target. */
+                                         * special shutdown target. On
+                                         * SUSE the boot.d/ runlevel
+                                         * is also used for shutdown,
+                                         * so we add links for that
+                                         * too to the shutdown
+                                         * target.*/
 
                                         if ((r = manager_load_unit(m, SPECIAL_SHUTDOWN_TARGET, NULL, &shutdown_target)) < 0)
                                                 goto finish;


More information about the systemd-commits mailing list