Skip to content

Commit

Permalink
Merge pull request #1770 from Expensify/tyler-shutdown-timestamp
Browse files Browse the repository at this point in the history
Save logline at shutdown
  • Loading branch information
justinpersaud authored Jun 5, 2024
2 parents db1d5be + 881b650 commit b2adefe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
///
#include <dlfcn.h>
#include <iostream>
#include <fstream>
#include <signal.h>
#include <sys/resource.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -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;
}

0 comments on commit b2adefe

Please sign in to comment.