]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-daemon: fix enable with conflicting ceph.target files
authorSage Weil <sage@redhat.com>
Fri, 25 Oct 2019 16:26:32 +0000 (11:26 -0500)
committerSage Weil <sage@redhat.com>
Fri, 25 Oct 2019 16:26:32 +0000 (11:26 -0500)
+ make description better

Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph-daemon

index 4d079199bec71c332f3960768770bebe7dd00ceb..34735653472f450e6b61c44f0164416c4387a8ca 100755 (executable)
@@ -478,13 +478,19 @@ def install_base_units(fsid):
     existed = os.path.exists(args.unit_dir + '/ceph.target')
     with open(args.unit_dir + '/ceph.target.new', 'w') as f:
         f.write('[Unit]\n'
-                'Description=all ceph service\n'
+                'Description=all ceph clusters and services\n'
                 '\n'
                 '[Install]\n'
                 'WantedBy=multi-user.target\n')
         os.rename(args.unit_dir + '/ceph.target.new',
                   args.unit_dir + '/ceph.target')
     if not existed:
+        # we disable before enable in case a different ceph.target
+        # (from the traditional package) is present; while newer
+        # systemd is smart enough to disable the old
+        # (/lib/systemd/...) and enable the new (/etc/systemd/...),
+        # some older versions of systemd error out with EEXIST.
+        call_throws(['systemctl', 'disable', 'ceph.target'])
         call_throws(['systemctl', 'enable', 'ceph.target'])
         call_throws(['systemctl', 'start', 'ceph.target'])