OPTION(monmap, OPT_STR, "")
OPTION(mon_host, OPT_STR, "")
OPTION(lockdep, OPT_BOOL, false)
-OPTION(admin_socket, OPT_STR, "/var/run/ceph/$cluster-$name.asok") // default changed by common_preinit()
+OPTION(run_dir, OPT_STR, "/var/run/ceph") // the "/var/run/ceph" dir, created on daemon startup
+OPTION(admin_socket, OPT_STR, "run_dir/$cluster-$name.asok") // default changed by common_preinit()
OPTION(daemonize, OPT_BOOL, false) // default changed by common_preinit()
OPTION(pid_file, OPT_STR, "") // default changed by common_preinit()
if (g_conf->log_flush_on_exit)
g_ceph_context->_log->set_flush_on_exit();
+ if (g_conf->run_dir.length() &&
+ code_env == CODE_ENVIRONMENT_DAEMON) {
+ int r = ::mkdir(g_conf->run_dir.c_str(), 0755);
+ if (r < 0 && errno != EEXIST) {
+ r = -errno;
+ derr << "warning: unable to create " << g_conf->run_dir << ": " << cpp_strerror(r) << dendl;
+ }
+ }
+
if (g_lockdep) {
dout(1) << "lockdep is enabled" << dendl;
lockdep_register_ceph_context(cct);