]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-14049] deal with systemd when stopping a mon otherwise raise an error 375/head
authorAlfredo Deza <adeza@redhat.com>
Thu, 10 Dec 2015 21:18:05 +0000 (16:18 -0500)
committerAlfredo Deza <adeza@redhat.com>
Thu, 10 Dec 2015 21:48:26 +0000 (16:48 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph_deploy/mon.py

index 849c0dc3f3311b8363223e63c8d6f1a0dc2be959..0ade4268dd1eb2d7e380a0d8d9c8bc476c34cf94 100644 (file)
@@ -7,7 +7,7 @@ import time
 from ceph_deploy import conf, exc, admin
 from ceph_deploy.cliutil import priority
 from ceph_deploy.util.help_formatters import ToggleRawTextHelpFormatter
-from ceph_deploy.util import paths, net, files, packages
+from ceph_deploy.util import paths, net, files, packages, system
 from ceph_deploy.lib import remoto
 from ceph_deploy.new import new_mon_keyring
 from ceph_deploy import hosts
@@ -344,6 +344,14 @@ def destroy_mon(conn, cluster, hostname):
                 'status',
                 'mon.{hostname}'.format(hostname=hostname),
             ]
+        elif system.is_systemd(conn):
+            status_args = [
+                'systemctl',
+                'stop',
+                'ceph-mon@{hostname}.service'.format(hostname=hostname),
+            ]
+        else:
+            raise RuntimeError('unsupported init system detected, cannot continue')
 
         while retries:
             conn.logger.info('polling the daemon to verify it stopped')