From 23a116f5d6db6eb1d986414ba973d5a49a52624f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 12 Jul 2019 14:06:10 -0500 Subject: [PATCH] qa/tasks/ceph_deploy: assume systemd and simplify shutdown wonkiness The 'service' command was succeeding but not actually stopping ceph. But we can safely assume systemd now so get rid of the weirdness here. Signed-off-by: Sage Weil (cherry picked from commit 97a45c9c2e8b6f6af51bf387636c9e4eaa228380) --- qa/tasks/ceph_deploy.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/qa/tasks/ceph_deploy.py b/qa/tasks/ceph_deploy.py index fc868b95ecfa8..a4e5921775ef7 100644 --- a/qa/tasks/ceph_deploy.py +++ b/qa/tasks/ceph_deploy.py @@ -511,25 +511,17 @@ def build_ceph_cluster(ctx, config): if config.get('keep_running'): return log.info('Stopping ceph...') - ctx.cluster.run(args=['sudo', 'stop', 'ceph-all', run.Raw('||'), - 'sudo', 'service', 'ceph', 'stop', run.Raw('||'), - 'sudo', 'systemctl', 'stop', 'ceph.target']) - - # Are you really not running anymore? - # try first with the init tooling - # ignoring the status so this becomes informational only - ctx.cluster.run( - args=[ - 'sudo', 'status', 'ceph-all', run.Raw('||'), - 'sudo', 'service', 'ceph', 'status', run.Raw('||'), - 'sudo', 'systemctl', 'status', 'ceph.target'], - check_status=False) + ctx.cluster.run(args=['sudo', 'systemctl', 'stop', 'ceph.target'], + check_status=False) + time.sleep(4) # and now just check for the processes themselves, as if upstart/sysvinit # is lying to us. Ignore errors if the grep fails ctx.cluster.run(args=['sudo', 'ps', 'aux', run.Raw('|'), 'grep', '-v', 'grep', run.Raw('|'), 'grep', 'ceph'], check_status=False) + ctx.cluster.run(args=['sudo', 'systemctl', run.Raw('|'), + 'grep', 'ceph'], check_status=False) if ctx.archive is not None: # archive mon data, too @@ -709,9 +701,7 @@ def cli_test(ctx, config): yield finally: log.info("cleaning up") - ctx.cluster.run(args=['sudo', 'stop', 'ceph-all', run.Raw('||'), - 'sudo', 'service', 'ceph', 'stop', run.Raw('||'), - 'sudo', 'systemctl', 'stop', 'ceph.target'], + ctx.cluster.run(args=['sudo', 'systemctl', 'stop', 'ceph.target'], check_status=False) time.sleep(4) for i in range(3): -- 2.39.5