X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fshutdown.c;h=b59aef174f14f1fd82e2069a0f406ebd43d46551;hb=0049f05a8bb82c3e084bacc5945596761d706c55;hp=cc8c57bd2d89e86f0ad0fa4a563d2221d3be06e7;hpb=f553b3b1074151200187df916427a1468186435e;p=elogind.git diff --git a/src/core/shutdown.c b/src/core/shutdown.c index cc8c57bd2..b59aef174 100644 --- a/src/core/shutdown.c +++ b/src/core/shutdown.c @@ -273,6 +273,13 @@ int main(int argc, char *argv[]) { } } + /* The kernel will automaticall flush ATA disks and suchlike + * on reboot(), but the file systems need to be synce'd + * explicitly in advance. So let's do this here, but not + * needlessly slow down containers. */ + if (!in_container) + sync(); + if (cmd == LINUX_REBOOT_CMD_KEXEC) { if (!in_container) {