# If this was a reconfig and the daemon is not a Ceph daemon, restart it
# so it can pick up potential changes to its configuration files
if deployment_type == DeploymentType.RECONFIG and daemon_type not in ceph_daemons():
- # ceph daemons do not need a restart; others (presumably) do to pick
- # up the new config
- call_throws(ctx, ['systemctl', 'reset-failed', ident.unit_name])
- call_throws(ctx, ['systemctl', 'restart', ident.unit_name])
+ if not ctx.skip_restart_for_reconfig:
+ # ceph daemons do not need a restart; others (presumably) do to pick
+ # up the new config
+ call_throws(ctx, ['systemctl', 'reset-failed', ident.unit_name])
+ call_throws(ctx, ['systemctl', 'restart', ident.unit_name])
+ elif ctx.send_signal_to_daemon:
+ ctx.signal_name = ctx.send_signal_to_daemon
+ ctx.signal_number = None
+ command_signal(ctx)
def clean_cgroup(ctx: CephadmContext, fsid: str, unit_name: str) -> None:
default=None,
help='Time in seconds to wait for graceful service shutdown before forcefully killing it'
)
+ parser_deploy.add_argument(
+ '--skip-restart-for-reconfig',
+ action='store_true',
+ default=False,
+ help='skip restart for non ceph daemons and perform default action'
+ )
+ parser_deploy.add_argument(
+ '--send-signal-to-daemon',
+ action='store_true',
+ default=False,
+ help='Send signal to daemon'
+ )
def _name_opts(parser: argparse.ArgumentParser) -> None:
def _daemon_action(self,
daemon_spec: CephadmDaemonDeploySpec,
action: str,
- image: Optional[str] = None) -> str:
+ image: Optional[str] = None,
+ skip_restart_for_reconfig: bool = False,
+ send_signal_to_daemon: Optional[str] = None) -> str:
self._daemon_action_set_image(action, image, daemon_spec.daemon_type,
daemon_spec.daemon_id)
daemon_spec)
with self.async_timeout_handler(daemon_spec.host, f'cephadm deploy ({daemon_spec.daemon_type} daemon)'):
return self.wait_async(
- CephadmServe(self)._create_daemon(daemon_spec, reconfig=(action == 'reconfig')))
+ CephadmServe(self)._create_daemon(daemon_spec, reconfig=(action == 'reconfig'),
+ skip_restart_for_reconfig=skip_restart_for_reconfig,
+ send_signal_to_daemon=send_signal_to_daemon))
actions = {
'start': ['reset-failed', 'start'],
dd.hostname, dd.name()
)
)
+ skip_restart_for_reconfig = False
+ send_signal_to_daemon = None
if not last_config:
self.log.info('Reconfiguring %s (unknown last config time)...' % (
dd.name()))
action = 'redeploy'
try:
daemon_spec = CephadmDaemonDeploySpec.from_daemon_description(dd)
- self.mgr._daemon_action(daemon_spec, action=action)
+ self.mgr._daemon_action(daemon_spec, action=action,
+ skip_restart_for_reconfig=skip_restart_for_reconfig,
+ send_signal_to_daemon=send_signal_to_daemon)
if self.mgr.cache.rm_scheduled_daemon_action(dd.hostname, dd.name()):
self.mgr.cache.save_host(dd.hostname)
except OrchestratorError as e:
daemon_spec: CephadmDaemonDeploySpec,
reconfig: bool = False,
osd_uuid_map: Optional[Dict[str, Any]] = None,
+ skip_restart_for_reconfig: bool = False,
+ send_signal_to_daemon: Optional[str] = None,
) -> str:
daemon_params: Dict[str, Any] = {}
if reconfig:
daemon_params['reconfig'] = True
+ if skip_restart_for_reconfig:
+ daemon_params['skip_restart_for_reconfig'] = True
+ if send_signal_to_daemon:
+ daemon_params['send_signal_to_daemon'] = send_signal_to_daemon
if self.mgr.allow_ptrace:
daemon_params['allow_ptrace'] = True