From 6149303d55c1a240ac878bbee7928cc7eb071447 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 31 Oct 2012 14:13:14 +0530 Subject: 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 BUG: 871063 Reviewed-on: http://review.gluster.org/4146 Reviewed-by: Niels de Vos Tested-by: Niels de Vos Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- glusterfsd/src/glusterfsd.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 1015a1305..1d28eb8da 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(); -- cgit