summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2012-11-28 17:27:17 +0100
committerTom Gundersen <teg@jklm.no>2012-11-28 18:26:35 +0100
commit02eaa78835fb994dbe609296d9b9d0c9b463cc1c (patch)
tree2d4e5f37d529a959425603fc383a1e642cda71aa
parent8050c22151aeaa8a0029e57bd28fc84d25077e4f (diff)
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.
-rw-r--r--src/core/shutdown.c2
1 files changed, 1 insertions, 1 deletions
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 &&