summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2016-02-10 18:27:38 -0500
committerAtin Mukherjee <amukherj@redhat.com>2016-07-04 20:54:19 -0700
commit8d41243f18c4a9c89028c8fc5e54b7e2b5e4309d (patch)
tree1177442efd9f080ccfdd4a202260361cd652ca4d /libglusterfs/src
parent0cd287189e5e9f876022a8c6481195bdc63ce5f8 (diff)
logging: Change log file name for glusterd
log file names are based on: a. user provided input (through -l switch while starting a gluster process) b. mount point paths in the case of native clients c. volume/configuration files used for starting a gluster process d. volume server used for starting a gluster process Currently glusterd uses scheme c. to have a log file name that reads as INSTALL_PREFIX-etc-glusterfs-glusterd.log Since glusterd has a well known configuration file, it does not make much sense to have log file name based on scheme c. This patch changes the name of glusterd's log file to "glusterd.log". Hopefully this enables users to identify glusterd's log file more easily. Change-Id: I2d04179c4b9b06271b50eeee3909ee259e8cf547 BUG: 1348944 Signed-off-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/13426 Tested-by: Atin Mukherjee <amukherj@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/common-utils.c12
-rw-r--r--libglusterfs/src/common-utils.h8
2 files changed, 18 insertions, 2 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 97d9ef8da1a..7b19208343f 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -3409,7 +3409,7 @@ out:
/* Sets log file path from user provided arguments */
int
-gf_set_log_file_path (cmd_args_t *cmd_args)
+gf_set_log_file_path (cmd_args_t *cmd_args, glusterfs_ctx_t *ctx)
{
int i = 0;
int j = 0;
@@ -3438,6 +3438,16 @@ gf_set_log_file_path (cmd_args_t *cmd_args)
goto done;
}
+ if (ctx && GF_GLUSTERD_PROCESS == ctx->process_mode) {
+ ret = gf_asprintf (&cmd_args->log_file,
+ DEFAULT_LOG_FILE_DIRECTORY "/%s.log",
+ GLUSTERD_NAME);
+ if (ret > 0)
+ ret = 0;
+
+ goto done;
+ }
+
if (cmd_args->volfile) {
j = 0;
i = 0;
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 4741d430a03..a83678fe322 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -68,6 +68,7 @@ void trap (void);
#define GEOREP "geo-replication"
#define GHADOOP "glusterfs-hadoop"
+#define GLUSTERD_NAME "glusterd"
#define GF_SELINUX_XATTR_KEY "security.selinux"
@@ -78,6 +79,11 @@ void trap (void);
!strcmp (fs_name, "ext3") || \
!strcmp (fs_name, "ext4"))
+/* process mode definitions */
+#define GF_SERVER_PROCESS 0
+#define GF_CLIENT_PROCESS 1
+#define GF_GLUSTERD_PROCESS 2
+
/* Defining this here as it is needed by glusterd for setting
* nfs port in volume status.
*/
@@ -216,7 +222,7 @@ int32_t gf_resolve_ip6 (const char *hostname, uint16_t port, int family,
void gf_log_dump_graph (FILE *specfp, glusterfs_graph_t *graph);
void gf_print_trace (int32_t signal, glusterfs_ctx_t *ctx);
-int gf_set_log_file_path (cmd_args_t *cmd_args);
+int gf_set_log_file_path (cmd_args_t *cmd_args, glusterfs_ctx_t *ctx);
int gf_set_log_ident (cmd_args_t *cmd_args);
#define VECTORSIZE(count) (count * (sizeof (struct iovec)))