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

Commit

Permalink
CORTX-32172: Fixes ADDB client logs to bundled it in rgw support bund…
Browse files Browse the repository at this point in the history
…le (#117)

Signed-off-by: Rahul Kumar <rahul.kumar@seagate.com>

Signed-off-by: Rahul Kumar <rahul.kumar@seagate.com>
Co-authored-by: Sachitanand Shelake <sachitanand.shelake@seagate.com>
Co-authored-by: Chetan S Deshmukh <chetan.deshmukh@seagate.com>
  • Loading branch information
3 people authored Aug 23, 2022
1 parent 1d8dc76 commit 0ef4c83
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
17 changes: 15 additions & 2 deletions src/rgw/setup/rgw.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ def config(conf: MappedConf):
os.environ['M0_TRACE_DIR'] = motr_trace_dir
Log.info('Created motr trace directory : %s' % os.environ.get('M0_TRACE_DIR'))

# Create motr addb directory for collecting addb files
# in case admin user creation issue during mini-provisioner execution.
Log.info('Creating motr addb_files- directory for collecting addb files..')
motr_fid_key = const.MOTR_ADMIN_FID_KEY
motr_fid_value = Conf.get(Rgw._conf_idx, motr_fid_key)
log_path = Rgw._get_log_dir_path(conf)
addb_dir = os.path.join(log_path, f'addb_files-{motr_fid_value}')
os.makedirs(addb_dir, exist_ok=True)
os.environ['M0_CLIENT_ADDB_DIR'] = addb_dir
Log.info('Created addb-files- directory : %s' % os.environ.get('M0_CLIENT_ADDB_DIR'))

# Change current working directory to rgw_debug for core file generation
Rgw._change_working_dir(conf)

Expand Down Expand Up @@ -147,17 +158,19 @@ def start(conf: MappedConf, index: str):
motr_fid_value = Conf.get(Rgw._conf_idx, motr_fid_key)
log_path = Rgw._get_log_dir_path(conf)
motr_trace_dir = os.path.join(log_path, 'motr_trace_files')
addb_dir = os.path.join(log_path, f'addb_files-{motr_fid_value}')
os.makedirs(motr_trace_dir, exist_ok=True)

addb_dir = os.path.join(log_path, f'addb_files-{motr_fid_value}')
os.makedirs(addb_dir, exist_ok=True)

# Create rgw crash file directory
rgw_core_dir = os.path.join(log_path, const.RGW_CORE_FILE_DIR_NAME)
os.makedirs(rgw_core_dir, exist_ok=True)

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

RgwService.start(conf, config_file, log_file, motr_trace_dir, rgw_core_dir, index)
RgwService.start(conf, config_file, log_file, motr_trace_dir, addb_dir, rgw_core_dir, index)
Log.info("Started radosgw service.")

return 0
Expand Down
5 changes: 3 additions & 2 deletions src/rgw/setup/rgw_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ class RgwService:
"""Entrypoint class for RGW."""

@staticmethod
def start(conf: MappedConf, config_file, log_file, motr_trace_dir, rgw_cwd, index: str = '1',):
def start(conf: MappedConf, config_file, log_file, motr_trace_dir, addb_dir, rgw_cwd, index: str = '1',):
"""Start rgw service independently."""
try:
os.environ['M0_TRACE_DIR'] = motr_trace_dir
os.environ['M0_CLIENT_ADDB_DIR'] = addb_dir
cmd = os.path.join(INSTALL_PATH, COMPONENT_NAME, 'bin/radosgw_start')
sys.stdout.flush()
sys.stderr.flush()
Expand All @@ -40,4 +41,4 @@ def start(conf: MappedConf, config_file, log_file, motr_trace_dir, rgw_cwd, inde
raise SetupError(e.errno, "Failed to start radosgw service. %s", e)
except Exception as e:
Log.error(f"Failed to start radosgw service:{e}")
raise SetupError(e, "Failed to start radosgw service. %s", e)
raise SetupError(e, "Failed to start radosgw service. %s", e)

0 comments on commit 0ef4c83

Please sign in to comment.