1
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2
// vim: ts=8 sw=2 smarttab
4
* Ceph - scalable distributed file system
6
* Copyright (C) 2004-2010 Sage Weil <sage@newdream.net>
7
* Copyright (C) 2010 Dreamhost
9
* This is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License version 2.1, as published by the Free Software
12
* Foundation. See file COPYING.
16
#include "common/common_init.h"
17
#include "common/ceph_argparse.h"
18
#include "common/config.h"
19
#include "tools/common.h"
26
int run_gui(int argc, char **argv);
30
static std::ostringstream gss;
34
derr << "usage: gceph [options]" << dendl;
36
derr << "Runs the ceph graphical monitor" << dendl;
37
generic_client_usage(); // Will exit()
40
static void parse_gceph_args(const vector<const char*> &args)
42
DEFINE_CONF_VARS(usage);
44
if (CEPH_ARGPARSE_EQ("help", 'h')) {
50
static int cephtool_run_gui(int argc, const char **argv)
55
// TODO: make sure that we capture the log this generates in the GUI
57
send_observe_requests();
60
return run_gui(argc, (char **)argv);
63
void ceph_tool_common_shutdown_wrapper()
65
ceph_tool_messenger_shutdown();
66
ceph_tool_common_shutdown();
69
int main(int argc, const char **argv)
73
DEFINE_CONF_VARS(usage);
74
vector<const char*> args;
75
argv_to_vec(argc, argv, args);
78
common_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
79
keyring_init(&g_conf);
81
vec_to_argv(args, argc, argv);
83
parse_gceph_args(args);
85
if (ceph_tool_common_init(CEPH_TOOL_MODE_GUI)) {
86
derr << "cephtool_common_init failed." << dendl;
90
atexit(ceph_tool_common_shutdown_wrapper);
92
if (cephtool_run_gui(argc, argv))
95
if (ceph_tool_messenger_shutdown())