X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fshutdown.c;h=0b7cbd8d3410e52ee13e7dca9877610a477b00a4;hp=1290d807f0eeaf13e19ec05af430782eb2833fb2;hb=4bfa638d43c05e8db052cd55818765bb3575a405;hpb=910212e738e5ecdc0ceebfcc5009d688415eaefc diff --git a/src/core/shutdown.c b/src/core/shutdown.c index 1290d807f..0b7cbd8d3 100644 --- a/src/core/shutdown.c +++ b/src/core/shutdown.c @@ -44,6 +44,7 @@ #include "mkdir.h" #include "virt.h" #include "watchdog.h" +#include "killall.h" #define FINALIZE_ATTEMPTS 50 @@ -108,14 +109,14 @@ static int pivot_to_new_root(void) { It works for pivot_root, but the ref count for the root device is not decreasing :-/ */ - if (mount(NULL, "/", NULL, MS_PRIVATE, NULL) < 0) { + if (mount(NULL, "/", NULL, MS_REC|MS_PRIVATE, NULL) < 0) { log_error("Failed to make \"/\" private mount %m"); return -errno; } if (pivot_root(".", "oldroot") < 0) { log_error("pivot failed: %m"); - /* only chroot if pivot root succeded */ + /* only chroot if pivot root succeeded */ return -errno; } @@ -176,10 +177,10 @@ int main(int argc, char *argv[]) { mlockall(MCL_CURRENT|MCL_FUTURE); log_info("Sending SIGTERM to remaining processes..."); - broadcast_signal(SIGTERM); + broadcast_signal(SIGTERM, true); log_info("Sending SIGKILL to remaining processes..."); - broadcast_signal(SIGKILL); + broadcast_signal(SIGKILL, true); if (in_container) { need_swapoff = false;