From 02eaa78835fb994dbe609296d9b9d0c9b463cc1c Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 28 Nov 2012 17:27:17 +0100 Subject: [PATCH] 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. --- src/core/shutdown.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/shutdown.c b/src/core/shutdown.c index b59aef174..4bb4b4d13 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 && -- 2.30.2