From: Tom Gundersen Date: Wed, 28 Nov 2012 16:27:17 +0000 (+0100) Subject: shutdown: don't pivot to /run/initramfs if already there X-Git-Tag: v197~176 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=02eaa78835fb994dbe609296d9b9d0c9b463cc1c;ds=sidebyside 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 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 &&