diff --git a/main.cpp b/main.cpp index b8eacd917..ff6ef35b4 100644 --- a/main.cpp +++ b/main.cpp @@ -4,6 +4,7 @@ /// #include #include +#include #include #include #include @@ -399,5 +400,13 @@ int main(int argc, char* argv[]) { // All done SINFO("Graceful process shutdown complete"); + + // Save that we're shutting down. + ofstream file("/var/log/bedrock_shutdown", std::ios::app); + if (file) { + file << "shutdown " << getpid() << " " << SComposeTime("%Y-%m-%dT%H:%M:%S", STimeNow()) << endl; + file.close(); + } + return 0; }