[systemd-commits] 2 commits - src/core

Tom Gundersen tomegun at kemper.freedesktop.org
Wed Nov 28 09:25:06 PST 2012


 src/core/shutdown.c |    2 +-
 src/core/umount.c   |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 140883405e429d9f8d3480a2701d8904f97e4a98
Author: Tom Gundersen <teg at jklm.no>
Date:   Wed Nov 28 18:08:54 2012 +0100

    shutdown: don't consider umounting of / and /usr failed
    
    In the words of Homer: If you don't try, you can't fail.
    
    This is a revert of 9279749b84cc87c7830280b7895a48bed03c9429.
    
    It used to be necessary to consider the umounting failed to make sure /
    and /usr were remounted read-only, but that is no longer necessary as
    everything is now remounted read-only anyway.
    
    Moreover, this avoids a warning at shutdown saying a filesystem was not
    unmounted. As the umounting of / is never attempted there was no
    corresponding warning message saying which fs that failed. This caused some
    spurious bug-reports from concerned users.
    
    Cc: Michael Biebl <biebl at debian.org>

diff --git a/src/core/umount.c b/src/core/umount.c
index e794057..5989a4c 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -433,15 +433,14 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
                 }
 
                 /* Skip / and /usr since we cannot unmount that
-                 * anyway, since we are running from it */
+                 * anyway, since we are running from it. They have already been
+                 * remounte ro. */
                 if (path_equal(m->path, "/")
 #ifndef HAVE_SPLIT_USR
                     || path_equal(m->path, "/usr")
 #endif
-                ) {
-                        n_failed++;
+                )
                         continue;
-                }
 
                 /* Trying to umount. Forcing to umount if busy (only for NFS mounts) */
                 if (umount2(m->path, MNT_FORCE) == 0) {

commit 02eaa78835fb994dbe609296d9b9d0c9b463cc1c
Author: Tom Gundersen <teg at jklm.no>
Date:   Wed Nov 28 17:27:17 2012 +0100

    shutdown: don't pivot to /run/initramfs if already there
    
    This allows systemd-shutdown to be installed as /run/initramfs/shutdown
    and take care of the proper teardown of the rootfs.

diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index b59aef1..4bb4b4d 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -263,7 +263,7 @@ int main(int argc, char *argv[]) {
         arguments[2] = NULL;
         execute_directory(SYSTEM_SHUTDOWN_PATH, NULL, arguments);
 
-        if (!in_container &&
+        if (!in_container && !in_initrd() &&
             access("/run/initramfs/shutdown", X_OK) == 0) {
 
                 if (prepare_new_root() >= 0 &&



More information about the systemd-commits mailing list