summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glusterfsd/src/glusterfsd.c19
-rw-r--r--libglusterfs/src/logging.c2
2 files changed, 17 insertions, 4 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 2d2024409ee..2f535e6be2e 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1047,6 +1047,16 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx)
process_mode = gf_get_process_mode (argv[0]);
+ /* Make sure after the parsing cli, if '--volfile-server' option is
+ given, then '--volfile-id' is mandatory */
+ if (cmd_args->volfile_server && !cmd_args->volfile_id) {
+ gf_log ("glusterfs", GF_LOG_CRITICAL,
+ "ERROR: '--volfile-id' is mandatory if '-s' OR "
+ "'--volfile-server' option is given");
+ ret = -1;
+ goto out;
+ }
+
if ((cmd_args->volfile_server == NULL)
&& (cmd_args->volfile == NULL)) {
if (process_mode == GF_SERVER_PROCESS)
@@ -1080,15 +1090,18 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx)
cmd_args->log_file);
if (ret == -1) {
fprintf (stderr, "ERROR: symlink of logfile failed\n");
- } else {
- GF_FREE (cmd_args->log_file);
- cmd_args->log_file = gf_strdup (tmp_logfile);
+ goto out;
}
+ GF_FREE (cmd_args->log_file);
+ cmd_args->log_file = gf_strdup (tmp_logfile);
+
GF_FREE (tmp_logfile_dyn);
}
}
+ ret = 0;
+out:
return ret;
}
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index 550aadef120..a492ac450d3 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -52,7 +52,7 @@ static gf_loglevel_t loglevel = GF_LOG_INFO;
static int gf_log_syslog = 1;
char gf_log_xl_log_set;
-gf_loglevel_t gf_log_loglevel; /* extern'd */
+gf_loglevel_t gf_log_loglevel = GF_LOG_INFO; /* extern'd */
FILE *gf_log_logfile;
static char *cmd_log_filename = NULL;