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.
This commit is contained in:
Tom Gundersen 2012-11-28 17:27:17 +01:00
parent 8050c22151
commit 02eaa78835
1 changed files with 1 additions and 1 deletions

View 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 &&