From: Alfredo Deza Date: Thu, 10 Dec 2015 21:18:05 +0000 (-0500) Subject: [RM-14049] deal with systemd when stopping a mon otherwise raise an error X-Git-Tag: v1.5.30~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F375%2Fhead;p=ceph-deploy.git [RM-14049] deal with systemd when stopping a mon otherwise raise an error Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py index 849c0dc..0ade426 100644 --- a/ceph_deploy/mon.py +++ b/ceph_deploy/mon.py @@ -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')