}
}
+static void set_cv(const char ** key, const char * const val)
+{
+ free((void*)*key);
+ *key = strdup(val);
+}
+
void common_init(std::vector<const char*>& args, const char *module_type, int flags)
{
bool force_fg_logging = false;
<< "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;
+
+ // some daemon-specific defaults
g_conf.daemonize = true;
+ g_conf.log_to_stderr = LOG_TO_STDERR_SOME;
+ g_conf.log_to_file = true;
+ set_cv(&g_conf.log_dir, "/var/log/ceph");
+ set_cv(&g_conf.pid_file, "/var/run/ceph/$type.$id.pid");
}
else {
g_conf.pid_file = 0;
OPTION(profiling_logger_subdir, 0, OPT_STR, 0),
OPTION(profiling_logger_dir, 0, OPT_STR, "/var/log/ceph/stat"),
OPTION(log_file, 0, OPT_STR, 0),
- OPTION(log_dir, 0, OPT_STR, "/var/log/ceph"),
+ OPTION(log_dir, 0, OPT_STR, ""),
OPTION(log_sym_dir, 0, OPT_STR, 0),
OPTION(log_sym_history, 0, OPT_INT, 10),
- OPTION(log_to_stderr, 0, OPT_INT, LOG_TO_STDERR_SOME),
+ OPTION(log_to_stderr, 0, OPT_INT, LOG_TO_STDERR_ALL),
OPTION(log_to_syslog, 0, OPT_BOOL, false),
OPTION(log_per_instance, 0, OPT_BOOL, false),
- OPTION(log_to_file, 0, OPT_BOOL, true),
+ OPTION(log_to_file, 0, OPT_BOOL, false),
OPTION(clog_to_monitors, 0, OPT_BOOL, true),
OPTION(clog_to_syslog, 0, OPT_BOOL, false),
- OPTION(pid_file, 0, OPT_STR, "/var/run/ceph/$type.$id.pid"),
+ OPTION(pid_file, 0, OPT_STR, ""),
OPTION(conf, 'c', OPT_STR, "/etc/ceph/ceph.conf, ~/.ceph/config, ceph.conf"),
OPTION(chdir, 0, OPT_STR, "/"),
OPTION(kill_after, 0, OPT_INT, 0),