Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 5ca5b9d

Browse files
committed
CORTX-32172: Fixes ADDB client logs to bundled it in rgw support bundle
Signed-off-by: Rahul Kumar <[email protected]>
1 parent fe45ad6 commit 5ca5b9d

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/rgw/setup/radosgw_start

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ INDEX=$1
44
CONFIG_FILE=$2
55
LOG_FILE=$3
66
RGW_CWD=$4
7+
ADDD_DIR=$5
78

9+
export M0_CLIENT_ADDB_DIR="$ADDD_DIR"
10+
echo "addb_files directories: $ADDD_DIR"
811
[ -z "$RGW_CWD" ] && RGW_CWD="$PWD"
912

1013
echo "Change RGW CWD to dir $RGW_CWD, to retain core files in there"

src/rgw/setup/rgw.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,19 @@ def start(conf: MappedConf, index: str):
153153
motr_fid_value = Conf.get(Rgw._conf_idx, motr_fid_key)
154154
log_path = Rgw._get_log_dir_path(conf)
155155
motr_trace_dir = os.path.join(log_path, 'motr_trace_files')
156-
addb_dir = os.path.join(log_path, f'addb_files-{motr_fid_value}')
157156
os.makedirs(motr_trace_dir, exist_ok=True)
157+
158+
addb_dir = os.path.join(log_path, f'addb_files-{motr_fid_value}')
158159
os.makedirs(addb_dir, exist_ok=True)
160+
159161
# Create rgw crash file directory
160162
rgw_core_dir = os.path.join(log_path, 'rgw_debug')
161163
os.makedirs(rgw_core_dir, exist_ok=True)
162164

163165
Log.info('Starting radosgw service.')
164166
log_file = os.path.join(log_path, f'{const.COMPONENT_NAME}_startup.log')
165167

166-
RgwService.start(conf, config_file, log_file, motr_trace_dir, rgw_core_dir, index)
168+
RgwService.start(conf, config_file, log_file, motr_trace_dir, addb_dir, rgw_core_dir, index)
167169
Log.info("Started radosgw service.")
168170

169171
return 0

src/rgw/setup/rgw_service.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ class RgwService:
2727
"""Entrypoint class for RGW."""
2828

2929
@staticmethod
30-
def start(conf: MappedConf, config_file, log_file, motr_trace_dir, rgw_cwd, index: str = '1',):
30+
def start(conf: MappedConf, config_file, log_file, motr_trace_dir, addb_dir, rgw_cwd, index: str = '1',):
3131
"""Start rgw service independently."""
3232
try:
3333
os.environ['M0_TRACE_DIR'] = motr_trace_dir
34+
os.environ['M0_CLIENT_ADDB_DIR'] = addb_dir
3435
cmd = os.path.join(INSTALL_PATH, COMPONENT_NAME, 'bin/radosgw_start')
3536
sys.stdout.flush()
3637
sys.stderr.flush()
37-
os.execl(cmd, cmd, index, config_file, log_file, rgw_cwd)
38+
os.execl(cmd, cmd, index, config_file, log_file, rgw_cwd, addb_dir)
3839
except OSError as e:
3940
Log.error(f"Failed to start radosgw service:{e}")
4041
raise SetupError(e.errno, "Failed to start radosgw service. %s", e)
4142
except Exception as e:
4243
Log.error(f"Failed to start radosgw service:{e}")
43-
raise SetupError(e, "Failed to start radosgw service. %s", e)
44+
raise SetupError(e, "Failed to start radosgw service. %s", e)

0 commit comments

Comments
 (0)