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

Commit 95fff2c

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 5acbb42 commit 95fff2c

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/rgw/setup/rgw.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ def config(conf: MappedConf):
117117
os.environ['M0_TRACE_DIR'] = motr_trace_dir
118118
Log.info('Created motr trace directory : %s' % os.environ.get('M0_TRACE_DIR'))
119119

120+
# Create motr addb directory for collecting addb files
121+
# in case admin user creation issue during mini-provisioner execution.
122+
Log.info('Creating motr addb_files- directory for collecting addb files..')
123+
motr_fid_key = const.MOTR_MY_FID % index
124+
motr_fid_value = Conf.get(Rgw._conf_idx, motr_fid_key)
125+
log_path = Rgw._get_log_dir_path(conf)
126+
addb_dir = os.path.join(log_path, f'addb_files-{motr_fid_value}')
127+
os.makedirs(addb_dir, exist_ok=True)
128+
os.environ['M0_CLIENT_ADDB_DIR'] = addb_dir
129+
Log.info('Created addb-files- directory : %s' % os.environ.get('M0_CLIENT_ADDB_DIR'))
130+
120131
# Change current working directory to rgw_debug for core file generation
121132
Rgw._change_working_dir(conf)
122133

@@ -147,17 +158,19 @@ def start(conf: MappedConf, index: str):
147158
motr_fid_value = Conf.get(Rgw._conf_idx, motr_fid_key)
148159
log_path = Rgw._get_log_dir_path(conf)
149160
motr_trace_dir = os.path.join(log_path, 'motr_trace_files')
150-
addb_dir = os.path.join(log_path, f'addb_files-{motr_fid_value}')
151161
os.makedirs(motr_trace_dir, exist_ok=True)
162+
163+
addb_dir = os.path.join(log_path, f'addb_files-{motr_fid_value}')
152164
os.makedirs(addb_dir, exist_ok=True)
165+
153166
# Create rgw crash file directory
154167
rgw_core_dir = os.path.join(log_path, 'rgw_debug')
155168
os.makedirs(rgw_core_dir, exist_ok=True)
156169

157170
Log.info('Starting radosgw service.')
158171
log_file = os.path.join(log_path, f'{const.COMPONENT_NAME}_startup.log')
159172

160-
RgwService.start(conf, config_file, log_file, motr_trace_dir, rgw_core_dir, index)
173+
RgwService.start(conf, config_file, log_file, motr_trace_dir, addb_dir, rgw_core_dir, index)
161174
Log.info("Started radosgw service.")
162175

163176
return 0

src/rgw/setup/rgw_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ 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()
@@ -40,4 +41,4 @@ def start(conf: MappedConf, config_file, log_file, motr_trace_dir, rgw_cwd, inde
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)