From 310f79118b87bb77adb2cf40a4097bb687fa5392 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Thu, 13 Apr 2017 18:34:18 +0530 Subject: logging: redirect configshell logs to GB_LOGDIR currently, GLOBAL CONFIG GROUP =================== [...] logfile=hello ------------- Logfile to use. [...] i.e. configshell logs are collected at 'hello' file. This patch will redirect configshell logs to 'GB_LOGDIR/gluster-block-configshell.log' Change-Id: I487c6197578c24412fbec72cb8c354725614de59 Fixes: #13 Signed-off-by: Prasanna Kumar Kalever --- rpc/block_svc_routines.c | 4 +++- utils/common.h | 31 +++++++++++++++++-------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/rpc/block_svc_routines.c b/rpc/block_svc_routines.c index 13a1132..6a4bced 100644 --- a/rpc/block_svc_routines.c +++ b/rpc/block_svc_routines.c @@ -28,7 +28,9 @@ # define GB_TGCLI_GLFS_CHECK GB_TGCLI_GLFS " ls > " DEVNULLPATH # define GB_TGCLI_CHECK GB_TGCLI_GLFS " ls | grep ' %s ' > " DEVNULLPATH # define GB_TGCLI_ISCSI "targetcli /iscsi" -# define GB_TGCLI_GLOBALS "targetcli set global auto_add_default_portal=false > " DEVNULLPATH +# define GB_TGCLI_GLOBALS "targetcli set " \ + "global auto_add_default_portal=false " \ + "logfile=" CONFIGSHELL_LOG_FILE " > " DEVNULLPATH # define GB_TGCLI_SAVE "targetcli / saveconfig > " DEVNULLPATH # define GB_TGCLI_ATTRIBUTES "generate_node_acls=1 demo_mode_write_protect=0 > " DEVNULLPATH # define GB_TGCLI_IQN_PREFIX "iqn.2016-12.org.gluster-block:" diff --git a/utils/common.h b/utils/common.h index c544029..c5ec334 100644 --- a/utils/common.h +++ b/utils/common.h @@ -14,25 +14,28 @@ # include "utils.h" -# define GB_LOGDIR DATADIR "/log/gluster-block" -# define GB_INFODIR DATADIR "/run" +# define GB_LOGDIR DATADIR "/log/gluster-block" +# define GB_INFODIR DATADIR "/run" -# define GB_LOCK_FILE GB_INFODIR "/gluster-blockd.lock" -# define GB_UNIX_ADDRESS GB_INFODIR "/gluster-blockd.socket" -# define GB_TCP_PORT 24006 +# define GB_LOCK_FILE GB_INFODIR "/gluster-blockd.lock" +# define GB_UNIX_ADDRESS GB_INFODIR "/gluster-blockd.socket" +# define GB_TCP_PORT 24006 -# define DAEMON_LOG_FILE GB_LOGDIR "/gluster-blockd.log" -# define CLI_LOG_FILE GB_LOGDIR "/gluster-block-cli.log" -#define DEVNULLPATH "/dev/null" +# define DAEMON_LOG_FILE GB_LOGDIR "/gluster-blockd.log" +# define CLI_LOG_FILE GB_LOGDIR "/gluster-block-cli.log" +#define DEVNULLPATH "/dev/null" -# define GFAPI_LOG_FILE GB_LOGDIR "/gluster-block-gfapi.log" -# define GFAPI_LOG_LEVEL 7 +# define GFAPI_LOG_FILE GB_LOGDIR "/gluster-block-gfapi.log" +# define GFAPI_LOG_LEVEL 7 -# define GB_METADIR "/block-meta" -# define GB_STOREDIR "/block-store" -# define GB_TXLOCKFILE "meta.lock" +# define CONFIGSHELL_LOG_FILE GB_LOGDIR "/gluster-block-configshell.log" + +# define GB_METADIR "/block-meta" +# define GB_STOREDIR "/block-store" +# define GB_TXLOCKFILE "meta.lock" + +# define SUN_PATH_MAX (sizeof(struct sockaddr_un) - sizeof(unsigned short int)) /*sun_family*/ -# define SUN_PATH_MAX (sizeof(struct sockaddr_un) - sizeof(unsigned short int)) /*sun_family*/ ssize_t glusterBlockCreateParseSize(const char *dom, char *value); -- cgit