summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-10-31 14:13:14 +0530
committerVijay Bellur <vbellur@redhat.com>2012-11-19 01:07:12 -0800
commit6149303d55c1a240ac878bbee7928cc7eb071447 (patch)
tree0c6ebdf61e30dbf28aded7fde4881d4d7fb964e4
parent702b2912970e7cc19416aff7d3696d15977efc2f (diff)
glusterfsd: log all command line options in log file
this would help support to make sure the glusterfs process received all the required options, as not all the options set with 'mount -t glusterfs' will be visible with 'mount' command. also one need not bother checking 'ps ax | grep gluster' for getting all the details of the command. Change-Id: Idf635904074bc0892abb6b707ff91149e92a33e3 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 871063 Reviewed-on: http://review.gluster.org/4146 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--glusterfsd/src/glusterfsd.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 1015a130505..1d28eb8da41 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1820,6 +1820,7 @@ main (int argc, char *argv[])
{
glusterfs_ctx_t *ctx = NULL;
int ret = -1;
+ char cmdlinestr[PATH_MAX] = {0,};
ctx = glusterfs_ctx_new ();
if (!ctx) {
@@ -1854,10 +1855,19 @@ main (int argc, char *argv[])
if (ret)
goto out;
- /* log the version of glusterfs running here */
- gf_log (argv[0], GF_LOG_INFO,
- "Started running %s version %s",
- argv[0], PACKAGE_VERSION);
+ /* log the version of glusterfs running here along with the actual
+ command line options. */
+ {
+ int i = 0;
+ strcpy (cmdlinestr, argv[0]);
+ for (i = 1; i < argc; i++) {
+ strcat (cmdlinestr, " ");
+ strcat (cmdlinestr, argv[i]);
+ }
+ gf_log (argv[0], GF_LOG_INFO,
+ "Started running %s version %s (%s)",
+ argv[0], PACKAGE_VERSION, cmdlinestr);
+ }
gf_proc_dump_init();