chiark / gitweb /
shutdown: don't pivot to /run/initramfs if already there
authorTom Gundersen <teg@jklm.no>
Wed, 28 Nov 2012 16:27:17 +0000 (17:27 +0100)
committerTom Gundersen <teg@jklm.no>
Wed, 28 Nov 2012 17:26:35 +0000 (18:26 +0100)
This allows systemd-shutdown to be installed as /run/initramfs/shutdown
and take care of the proper teardown of the rootfs.

src/core/shutdown.c

index b59aef1..4bb4b4d 100644 (file)
@@ -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 &&