]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common_init: don't modify log_per_instance
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 29 Apr 2011 17:21:08 +0000 (10:21 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 29 Apr 2011 17:21:26 +0000 (10:21 -0700)
check it in DoutStreambuf instead.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/common/DoutStreambuf.cc
src/common/common_init.cc

index a705eee3b1a721af1f769e5b483f8cd81eebec1f..9ac48db348fb5c5f128a9234524dcce31dd283f6 100644 (file)
@@ -400,7 +400,7 @@ _calculate_opath(const md_config_t *conf) const
   // If conf->log_file was specified, that takes the highest priority
   if (!conf->log_file.empty()) {
     string log_file(normalize_relative(conf->log_file.c_str()));
-    if (conf->log_per_instance) {
+    if ((conf->log_per_instance) && (g_code_env == CODE_ENVIRONMENT_DAEMON)) {
       ostringstream oss;
       oss << log_file << "." << getpid();
       return oss.str();
@@ -415,7 +415,7 @@ _calculate_opath(const md_config_t *conf) const
   else
     log_dir = normalize_relative(conf->log_dir.c_str());
 
-  if (conf->log_per_instance) {
+  if ((conf->log_per_instance) && (g_code_env == CODE_ENVIRONMENT_DAEMON)) {
     char hostname[255];
     memset(hostname, 0, sizeof(hostname));
     int ret = gethostname(hostname, sizeof(hostname));
@@ -467,7 +467,7 @@ _read_ofile_config(const md_config_t *conf)
 
   symlink_dir = _get_symlink_dir(conf);
 
-  if (conf->log_per_instance) {
+  if ((conf->log_per_instance) && (g_code_env == CODE_ENVIRONMENT_DAEMON)) {
     // Calculate instance symlink path (isym_path)
     ostringstream iss;
     iss << symlink_dir << "/" << conf->name.to_str();
index 1c84e033ece64a94ee0533174c5e864b2cedf7a0..cfc6158a46117750ef6388ca59be9e786f5b0934 100644 (file)
@@ -164,11 +164,6 @@ void common_init(std::vector < const char* >& args,
 
   conf->parse_argv(args); // argv override
 
-  if (code_env != CODE_ENVIRONMENT_DAEMON) {
-    // The symlink stuff only really makes sense for daemons
-    conf->log_per_instance = false;
-  }
-
   // Expand metavariables. Invoke configuration observers.
   conf->apply_changes();