// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2004-2006 Sage Weil * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software * Foundation. See file COPYING. * */ #include #include #include #include #include #include using namespace std; #include "config.h" #include "mon/MonMap.h" #include "mds/MDS.h" #include "msg/SimpleMessenger.h" #include "common/Timer.h" #include "common/common_init.h" #include "mon/MonClient.h" void usage() { cerr << "usage: cmds -i name [flags] [--mds rank] [--shadow rank]\n"; cerr << " -m monitorip:port\n"; cerr << " connect to monitor at given address\n"; cerr << " --debug_mds n\n"; cerr << " debug MDS level (e.g. 10)\n"; generic_server_usage(); } int main(int argc, const char **argv) { vector args; argv_to_vec(argc, argv, args); env_to_vec(args); common_init(args, "mds", true); // mds specific args for (unsigned i=0; iinit(); rank.wait(); // yuck: grab the mds lock, so we can be sure that whoever in *mds // called shutdown finishes what they were doing. mds->mds_lock.Lock(); mds->mds_lock.Unlock(); // only delete if it was a clean shutdown (to aid memory leak // detection, etc.). don't bother if it was a suicide. if (mds->is_stopped()) delete mds; // cd on exit, so that gmon.out (if any) goes into a separate directory for each node. char s[20]; sprintf(s, "gmon/%d", getpid()); if (mkdir(s, 0755) == 0) chdir(s); generic_dout(0) << "stopped." << dendl; return 0; }