}
""" % fsid)
-def deploy_crash(fsid, uid, gid, config, keyring):
- # type: (str, int, int, str, str) -> None
- crash_dir = os.path.join(args.data_dir, fsid, 'crash')
- makedirs(crash_dir, uid, gid, DATA_DIR_MODE)
- c = get_container(fsid, 'crash', get_hostname())
- deploy_daemon(fsid, 'crash', get_hostname(), c, uid, gid,
- config, keyring)
-
def get_unit_file(fsid, uid, gid):
# type: (str, int, int) -> str
install_path = find_program('install')
mgr_c = get_container(fsid, 'mgr', mgr_id)
deploy_daemon(fsid, 'mgr', mgr_id, mgr_c, uid, gid, config, mgr_keyring)
- # crash unit
- logger.info('Creating crash agent...')
- deploy_crash(fsid, uid, gid, config,
- '[client.crash.%s]\n\tkey = %s\n' % (hostname, crash_key))
-
# output files
with open(args.output_keyring, 'w') as f:
os.fchmod(f.fileno(), 0o600)
osd_fsid=args.osd_fsid,
reconfig=args.reconfig)
- if crash_keyring and not args.reconfig:
- deploy_crash(args.fsid, uid, gid, config, crash_keyring)
-
elif daemon_type in Monitoring.components:
# monitoring daemon - prometheus, grafana, alertmanager, node-exporter
monitoring_args = [] # type: List[str]
if extra_config:
config += extra_config
- if daemon_type != 'crash':
- # crash_keyring
- ret, crash_keyring, err = self.mon_command({
- 'prefix': 'auth get-or-create',
- 'entity': 'client.crash.%s' % host,
- 'caps': ['mon', 'profile crash',
- 'mgr', 'profile crash'],
- })
- else:
- crash_keyring = None
-
j = json.dumps({
'config': config,
'keyring': keyring,
- 'crash_keyring': crash_keyring,
})
extra_args.extend(['--config-and-keyrings', '-'])