]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/ceph_deploy: work with systemd
authorSage Weil <sage@redhat.com>
Mon, 31 Aug 2015 18:21:29 +0000 (14:21 -0400)
committerSage Weil <sage@redhat.com>
Mon, 31 Aug 2015 18:21:29 +0000 (14:21 -0400)
This is ugly, but I'm not going to rewrite this right now.

Signed-off-by: Sage Weil <sage@redhat.com>
tasks/ceph_deploy.py

index 26d320a97e11f73aab7551b6ba1bfece2e145608..1a851471597fc149ec7145f27558eb0f5e3082c6 100644 (file)
@@ -376,14 +376,18 @@ def build_ceph_cluster(ctx, config):
             return
         log.info('Stopping ceph...')
         ctx.cluster.run(args=['sudo', 'stop', 'ceph-all', run.Raw('||'),
-                              'sudo', 'service', 'ceph', 'stop' ])
+                              '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'],
-                              check_status=False)
+        ctx.cluster.run(
+            args=[
+                'sudo', 'status', 'ceph-all', run.Raw('||'),
+                'sudo', 'service',  'ceph', 'status', run.Raw('||'),
+                'sudo', 'systemctl', 'status', 'ceph.target'],
+            check_status=False)
 
         # and now just check for the processes themselves, as if upstart/sysvinit
         # is lying to us. Ignore errors if the grep fails
@@ -555,11 +559,10 @@ def cli_test(ctx, config):
         yield
     finally:
         log.info("cleaning up")
-        if system_type == 'deb':
-            remote.run(args=['sudo', 'stop','ceph-all'],check_status=False)
-            remote.run(args=['sudo', 'service','ceph', '-a', 'stop'],check_status=False)
-        else:
-            remote.run(args=['sudo', '/etc/init.d/ceph', '-a', 'stop'],check_status=False)
+        ctx.cluster.run(args=['sudo', 'stop', 'ceph-all', run.Raw('||'),
+                              'sudo', 'service', 'ceph', 'stop', run.Raw('||'),
+                              'sudo', 'systemctl', 'stop', 'ceph.target'],
+                        check_status=False)
         time.sleep(4)
         for i in range(3):
             umount_dev = "{d}1".format(d=devs[i])