diff --git a/oam/install_scripts/mcs-loadbrm.py.in b/oam/install_scripts/mcs-loadbrm.py.in index fdf9ae7ba..985545539 100644 --- a/oam/install_scripts/mcs-loadbrm.py.in +++ b/oam/install_scripts/mcs-loadbrm.py.in @@ -28,6 +28,10 @@ def get_port(): if __name__ == '__main__': + # To avoid systemd in container environment + use_systemd = True + if len(sys.argv) > 1: + use_systemd = not sys.argv[1] == 'no' sm_config = configparser.ConfigParser() sm_config.read('/etc/columnstore/storagemanager.cnf') @@ -48,13 +52,14 @@ if __name__ == '__main__': brm_saves_current = '' if storage.lower() == 's3' and not bucket.lower() == 'some_bucket': - # start SM - cmd = 'systemctl start mcs-storagemanager' - retcode = subprocess.call(cmd, shell=True) - if retcode < 0: - print('Failed to start storagemanager. \ + # start SM using systemd + if use_systemd is True: + cmd = 'systemctl start mcs-storagemanager' + retcode = subprocess.call(cmd, shell=True) + if retcode < 0: + print('Failed to start storagemanager. \ {} exits with {}.'.format(cmd, retcode)) - sys.exit(1) + sys.exit(1) brm = 'data1/systemFiles/dbrm/BRM_saves_current' config_root.find('./Installation/DBRootStorageType').text = "StorageManager" @@ -90,7 +95,7 @@ Please install CMAPI first.', file=sys.stderr) primary_address = config_root.find('./DBRM_Controller/IPAddr').text api_key = get_key() if len(api_key) == 0: - print('Failed to find API key in {}.'.format(api_config_file), \ + print('Failed to find API key in {}.'.format(API_CONFIG_PATH), \ file=sys.stderr) sys.exit(1) headers = {'x-api-key': api_key}