From: Sebastian Wagner Date: Wed, 26 Aug 2020 12:53:09 +0000 (+0200) Subject: mgr/cephadm: Call cephadm with --container-image X-Git-Tag: v15.2.9~122^2~44^2~37 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a05839c2294188dc7a66d764f6ed286d540995f5;p=ceph.git mgr/cephadm: Call cephadm with --container-image The kernel treats any process with PID 1 different. Especially it does not generate a core dump. Call podman / docker with --init in order to get core dumps. In addition, we can now properly reap zombies processes. Fixes: https://tracker.ceph.com/issues/44231 Signed-off-by: Sebastian Wagner (cherry picked from commit 533931505272d215a1b4fa40b3bf235cf2110102) --- diff --git a/doc/man/8/cephadm.rst b/doc/man/8/cephadm.rst index 982a01f1bfd..5a1da7a040e 100644 --- a/doc/man/8/cephadm.rst +++ b/doc/man/8/cephadm.rst @@ -28,6 +28,7 @@ Synopsis | **cephadm** **adopt** [-h] --name NAME --style STYLE [--cluster CLUSTER] | [--legacy-dir LEGACY_DIR] [--config-json CONFIG_JSON] | [--skip-firewalld] [--skip-pull] +| [--container-init] | **cephadm** **rm-daemon** [-h] --name NAME --fsid FSID [--force] | [--force-delete-data] diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 1b524217cba..12c9ff99cbf 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3028,6 +3028,9 @@ def command_bootstrap(): cli(['config', 'set', 'mgr', 'mgr/cephadm/registry_username', args.registry_username, '--force']) cli(['config', 'set', 'mgr', 'mgr/cephadm/registry_password', args.registry_password, '--force']) + if args.container_init: + cli(['config', 'set', 'mgr', 'mgr/cephadm/container_init', args.container_init, '--force']) + if not args.skip_dashboard: # Configure SSL port (cephadm only allows to configure dashboard SSL port) # if the user does not want to use SSL he can change this setting once the cluster is up @@ -5384,6 +5387,10 @@ def _get_parser(): '--force-start', action='store_true', help="start newly adoped daemon, even if it wasn't running previously") + parser_adopt.add_argument( + '--container-init', + action='store_true', + help='Run podman/docker with `--init`') parser_rm_daemon = subparsers.add_parser( 'rm-daemon', help='remove daemon instance') diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 9471ac84a7f..eb3fe837008 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -214,6 +214,12 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): 'can allow debugging daemons that encounter problems ' 'at runtime.', }, + { + 'name': 'container_init', + 'type': 'bool', + 'default': False, + 'desc': 'Run podman/docker with `--init`', + }, { 'name': 'prometheus_alerts_path', 'type': 'str', @@ -295,6 +301,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): self.warn_on_stray_daemons = True self.warn_on_failed_host_check = True self.allow_ptrace = False + self.container_init = False self.prometheus_alerts_path = '' self.migration_current = None self.config_dashboard = True @@ -1168,6 +1175,10 @@ To check that the host is reachable: if not no_fsid: final_args += ['--fsid', self._cluster_fsid] + + if self.container_init: + final_args += ['--container-init'] + final_args += args self.log.debug('args: %s' % (' '.join(final_args)))