env_to_vec(args);
DEFINE_CONF_VARS(usage);
- common_set_defaults(false);
common_init(args, "cauthtool", STARTUP_FLAG_FORCE_FG_LOGGING);
const char *me = argv[0];
}
}
- common_set_defaults(false);
common_init(nargs, type, STARTUP_FLAG_FORCE_FG_LOGGING);
if (do_help) {
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
g_conf.daemonize = true;
+ g_conf.pid_file = 0;
g_conf.log_per_instance = true;
common_init(args, "cfuse", STARTUP_FLAG_INIT_KEYS);
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(true);
#ifdef HAVE_LIBTCMALLOC
g_conf.profiler_start = HeapProfilerStart;
g_conf.profiler_running = IsHeapProfilerRunning;
g_conf.profiler_dump = HeapProfilerDump;
g_conf.tcmalloc_have = true;
#endif //HAVE_LIBTCMALLOC
- common_init(args, "mds", STARTUP_FLAG_INIT_KEYS);
+ common_init(args, "mds", STARTUP_FLAG_INIT_KEYS | STARTUP_FLAG_DAEMON);
// mds specific args
int shadow = 0;
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(true);
- common_init(args, "mon", STARTUP_FLAG_INIT_KEYS);
+ common_init(args, "mon", STARTUP_FLAG_INIT_KEYS | STARTUP_FLAG_DAEMON);
FOR_EACH_ARG(args) {
if (CONF_ARG_EQ("mkfs", '\0')) {
g_conf.log_to_file = false;
}
-void common_set_defaults(bool daemon)
-{
- if (daemon) {
- cout << TEXT_YELLOW << " ** WARNING: Ceph is still under heavy development, and is only suitable for **" << TEXT_NORMAL << std::endl;
- cout << TEXT_YELLOW << " ** testing and review. Do not trust it with important data. **" << TEXT_NORMAL << std::endl;
-
- g_conf.daemonize = true;
- } else {
- g_conf.pid_file = 0;
- }
-}
-
static void keyring_init(const char *filesearch)
{
const char *filename = filesearch;
void common_init(std::vector<const char*>& args, const char *module_type, int flags)
{
bool force_fg_logging = false;
+
+ if (flags & STARTUP_FLAG_DAEMON) {
+ cout << TEXT_YELLOW << " ** WARNING: Ceph is still under heavy development, "
+ << "and is only suitable for **" << TEXT_NORMAL << std::endl;
+ cout << TEXT_YELLOW << " ** testing and review. Do not trust it "
+ << "with important data. **" << TEXT_NORMAL << std::endl;
+ g_conf.daemonize = true;
+ }
+ else {
+ g_conf.pid_file = 0;
+ }
+
parse_startup_config_options(args, module_type, flags, &force_fg_logging);
if (g_conf.log_to_syslog || g_conf.clog_to_syslog) {
enum {
STARTUP_FLAG_INIT_KEYS = 0x01,
STARTUP_FLAG_FORCE_FG_LOGGING = 0x02,
+ STARTUP_FLAG_DAEMON = 0x04,
};
-void common_set_defaults(bool daemon);
void common_init(std::vector<const char*>& args,
const char *module_type,
int flags);
vector<const char*> args;
argv_to_vec(argc, argv, args);
env_to_vec(args);
- int startup_flags = STARTUP_FLAG_INIT_KEYS;
+ int startup_flags = STARTUP_FLAG_INIT_KEYS | STARTUP_FLAG_DAEMON;
vector<const char *>::iterator args_iter;
for (args_iter = args.begin(); args_iter != args.end(); ++args_iter) {
}
}
- common_set_defaults(true);
#ifdef HAVE_LIBTCMALLOC
g_conf.profiler_start = HeapProfilerStart;
g_conf.profiler_running = IsHeapProfilerRunning;
vector<const char*> args;
argv_to_vec(argc, argv, args);
- common_set_defaults(false);
common_init(args, "csyn",
STARTUP_FLAG_INIT_KEYS | STARTUP_FLAG_FORCE_FG_LOGGING);
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "dumpjournal", STARTUP_FLAG_FORCE_FG_LOGGING);
vec_to_argv(args, argc, argv);
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "dumpstore", STARTUP_FLAG_FORCE_FG_LOGGING);
// args
//create everything to start a client
vector<const char*> args;
argv_to_vec(argc, argv, args);
- common_set_defaults(false);
common_init(args, "libceph", STARTUP_FLAG_INIT_KEYS);
//monmap
monclient = new MonClient();
++i;
}
- common_set_defaults(false);
common_init(args, "librados-config", STARTUP_FLAG_FORCE_FG_LOGGING);
FOR_EACH_ARG(args) {
argv_to_vec(argc, argv, args);
env_to_vec(args);
}
- common_set_defaults(false);
common_init(args, "librados", STARTUP_FLAG_INIT_KEYS);
return 0;
vector<const char*> args;
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "librados", STARTUP_FLAG_INIT_KEYS);
++rados_initialized;
env_to_vec(args);
DEFINE_CONF_VARS(usage);
- common_set_defaults(false);
common_init(args, "osdmaptool", STARTUP_FLAG_FORCE_FG_LOGGING);
const char *me = argv[0];
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "rados",
STARTUP_FLAG_FORCE_FG_LOGGING | STARTUP_FLAG_INIT_KEYS);
env_to_vec(args);
int opt_cmd = OPT_NO_CMD;
- common_set_defaults(false);
common_init(args, "rbd",
STARTUP_FLAG_FORCE_FG_LOGGING | STARTUP_FLAG_INIT_KEYS);
argv_to_vec(argc, (const char **)argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "rgw",
STARTUP_FLAG_FORCE_FG_LOGGING | STARTUP_FLAG_INIT_KEYS);
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, NULL,
STARTUP_FLAG_FORCE_FG_LOGGING | STARTUP_FLAG_INIT_KEYS);
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "ceph", STARTUP_FLAG_FORCE_FG_LOGGING);
DoutStreambuf<char> *dos = new DoutStreambuf<char>();
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "TestSignalHandlers", STARTUP_FLAG_FORCE_FG_LOGGING);
DEFINE_CONF_VARS(usage);
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "ceph", STARTUP_FLAG_FORCE_FG_LOGGING);
int ret;
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, NULL, STARTUP_FLAG_FORCE_FG_LOGGING);
// args
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, NULL, STARTUP_FLAG_FORCE_FG_LOGGING);
vec_to_argv(args, argc, argv);
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "ceph",
STARTUP_FLAG_INIT_KEYS | STARTUP_FLAG_FORCE_FG_LOGGING);
argv_to_vec(argc, argv, args);
env_to_vec(args);
- common_set_defaults(false);
common_init(args, "cephtool",
STARTUP_FLAG_FORCE_FG_LOGGING | STARTUP_FLAG_INIT_KEYS);