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>
This commit is contained in:
Amar Tumballi 2012-10-31 14:13:14 +05:30 committed by Vijay Bellur
parent 702b291297
commit 6149303d55

View File

@ -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();