]>
git.proxmox.com Git - ceph.git/blob - ceph/src/ceph_mgr.cc
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) 2015 Red Hat Inc
8 * Author: John Spray <john.spray@redhat.com>
10 * This is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License version 2.1, as published by the Free Software
13 * Foundation. See file COPYING.
21 #include "include/types.h"
22 #include "include/compat.h"
23 #include "common/config.h"
24 #include "common/ceph_argparse.h"
25 #include "common/errno.h"
26 #include "common/pick_address.h"
27 #include "global/global_init.h"
29 #include "mgr/MgrStandby.h"
33 cout
<< "usage: ceph-mgr -i <ID> [flags]\n"
35 generic_server_usage();
39 * A short main() which just instantiates a MgrStandby and
40 * hands over control to that.
42 int main(int argc
, const char **argv
)
44 ceph_pthread_setname(pthread_self(), "ceph-mgr");
46 vector
<const char*> args
;
47 argv_to_vec(argc
, argv
, args
);
49 cerr
<< argv
[0] << ": -h or --help for usage" << std::endl
;
52 if (ceph_argparse_need_usage(args
)) {
57 map
<string
,string
> defaults
= {
58 { "keyring", "$mgr_data/keyring" }
60 auto cct
= global_init(&defaults
, args
, CEPH_ENTITY_TYPE_MGR
,
61 CODE_ENVIRONMENT_DAEMON
, 0,
64 pick_addresses(g_ceph_context
, CEPH_PICK_ADDRESS_PUBLIC
);
66 global_init_daemonize(g_ceph_context
);
67 global_init_chdir(g_ceph_context
);
68 common_init_finish(g_ceph_context
);
70 MgrStandby
mgr(argc
, argv
);
73 std::cerr
<< "Error in initialization: " << cpp_strerror(rc
) << std::endl
;
77 return mgr
.main(args
);