]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Call cephadm with --container-image
authorSebastian Wagner <sebastian.wagner@suse.com>
Wed, 26 Aug 2020 12:53:09 +0000 (14:53 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 6 Oct 2020 09:40:53 +0000 (11:40 +0200)
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 <sebastian.wagner@suse.com>
(cherry picked from commit 533931505272d215a1b4fa40b3bf235cf2110102)

doc/man/8/cephadm.rst
src/cephadm/cephadm
src/pybind/mgr/cephadm/module.py

index 982a01f1bfd948d1a6d2824e66345e37de34126c..5a1da7a040e3257ec3329d64ebc26c38d2f2b0c5 100644 (file)
@@ -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]
index 1b524217cba82db533c8b93de66760690fb1c6ca..12c9ff99cbfbb830ce7f744c4687df0e841e2d28 100755 (executable)
@@ -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')
index 9471ac84a7f729099da503919dfca06009044d4c..eb3fe8370088476f690a7655a663ade986701a6e 100644 (file)
@@ -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)))