111
111
static int switchroot(const char *newroot)
113
113
/* Don't try to unmount the old "/", there's no way to do it. */
114
const char *umounts[] = { "/dev", "/proc", "/sys", NULL };
114
const char *umounts[] = { "/dev", "/proc", "/sys", "/run", NULL };
119
125
for (i = 0; umounts[i] != NULL; i++) {
122
128
snprintf(newmount, sizeof(newmount), "%s%s", newroot, umounts[i]);
124
136
if (mount(umounts[i], newmount, NULL, MS_MOVE, NULL) < 0) {
125
137
warn("failed to mount moving %s to %s",