diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 6f7170d..8e5096e 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -2,3 +2,4 @@ CREATE_CLIENT_EXECUTABLE(dump_blockmap) CREATE_CLIENT_EXECUTABLE(drop_database) CREATE_CLIENT_EXECUTABLE(space_usage) CREATE_CLIENT_EXECUTABLE(histogram) +CREATE_CLIENT_EXECUTABLE(shutdown) diff --git a/util/shutdown.cpp b/util/shutdown.cpp new file mode 100644 index 0000000..cfba3b6 --- /dev/null +++ b/util/shutdown.cpp @@ -0,0 +1,29 @@ +/* + * shtudown.cpp + * + * Created on: Aug 16, 2010 + * Author: sears + */ + +#include "../tcpclient.h" +#include "../network.h" +#include "../datatuple.h" + +void usage(char * argv[]) { + fprintf(stderr, "usage %s [host [port]]\n", argv[0]); +} +#include "util_main.h" +int main(int argc, char * argv[]) { + logstore_handle_t * l = util_open_conn(argc, argv); + + datatuple * ret = logstore_client_op(l, OP_SHUTDOWN); + + if(ret == NULL) { + perror("Shutdown failed."); return 3; + } else { + datatuple::freetuple(ret); + } + logstore_client_close(l); + printf("Shutdown in progress\n"); + return 0; +}