loop_interval = 30
stop = False
- required_files = ['cephadm', 'agent.json', 'keyring']
+ required_files = ['agent.json', 'keyring']
def __init__(self, ctx: CephadmContext, fsid: str, daemon_id: Union[int, str] = ''):
self.ctx = ctx
self.target_port = ''
self.host = ''
self.daemon_dir = os.path.join(ctx.data_dir, self.fsid, f'{self.daemon_type}.{self.daemon_id}')
- self.binary_path = os.path.join(self.daemon_dir, 'cephadm')
self.config_path = os.path.join(self.daemon_dir, 'agent.json')
self.keyring_path = os.path.join(self.daemon_dir, 'keyring')
self.ca_path = os.path.join(self.daemon_dir, 'root_cert.pem')
def unit_run(self) -> str:
py3 = shutil.which('python3')
- return ('set -e\n' + f'{py3} {self.binary_path} agent --fsid {self.fsid} --daemon-id {self.daemon_id} &\n')
+ binary_path = os.path.realpath(sys.argv[0])
+ return ('set -e\n' + f'{py3} {binary_path} agent --fsid {self.fsid} --daemon-id {self.daemon_id} &\n')
def unit_file(self) -> str:
return """#generated by cephadm
self.mgr.inventory.get_addr(daemon_spec.host))
config = {
'agent.json': json.dumps(cfg),
- 'cephadm': self.mgr._cephadm,
'keyring': daemon_spec.keyring,
'root_cert.pem': self.mgr.cherrypy_thread.ssl_certs.get_root_cert(),
'listener.crt': listener_cert,