From f710812550139a76c1a52dbae106820d4d621882 Mon Sep 17 00:00:00 2001 From: Matthieu Dorier Date: Wed, 1 May 2019 15:19:38 -0500 Subject: [PATCH] added shutdown executable --- bin/CMakeLists.txt | 4 ++++ bin/hepnos-shutdown.cpp | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 bin/hepnos-shutdown.cpp diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index d425cb2..c8ec7cb 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -1,4 +1,8 @@ add_executable(hepnos-daemon hepnos-daemon.cpp) target_link_libraries(hepnos-daemon hepnos-service yaml-cpp margo bake-server sdskv-server) +add_executable(hepnos-shutdown hepnos-shutdown.cpp) +target_link_libraries(hepnos-shutdown hepnos yaml-cpp margo) + +install(TARGETS hepnos-shutdown DESTINATION bin) install(TARGETS hepnos-daemon DESTINATION bin) diff --git a/bin/hepnos-shutdown.cpp b/bin/hepnos-shutdown.cpp new file mode 100644 index 0000000..2de7505 --- /dev/null +++ b/bin/hepnos-shutdown.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main(int argc, char* argv[]) +{ + if(argc != 2) { + std::cerr << "Usage: " << argv[0] << " " << std::endl; + exit(-1); + } + + hepnos::DataStore datastore(argv[1]); + datastore.shutdown(); + + return 0; +} -- 2.26.2