summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2014-08-21 16:21:26 +0200
committerHarald Hoyer <harald@redhat.com>2014-08-28 15:25:15 +0200
commit5a4bf02ff57e4dd3453f2b868c72fe45f60033a3 (patch)
tree2dfa5385d7af4ad0e8cc040a0a46807e103387c1 /src/core/main.c
parent667a0377fb25ddb0c3efbc43d186ffd4c097ce41 (diff)
use the switch_root function in shutdown
removes code duplication also move switch-root to shared
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 95ab40fffc..64c2b3f3a1 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1853,8 +1853,8 @@ finish:
* deserializing. */
broadcast_signal(SIGTERM, false, true);
- /* And switch root */
- r = switch_root(switch_root_dir);
+ /* And switch root with MS_MOVE, because we remove the old directory afterwards and detach it. */
+ r = switch_root(switch_root_dir, "/mnt", true, MS_MOVE);
if (r < 0)
log_error("Failed to switch root, ignoring: %s", strerror(-r));
}