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 b59aef174f14f1fd82e2069a0f406ebd43d46551..4bb4b4d13e435e157a950907762d5902fce246c6 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 &&