From: Sage Weil Date: Fri, 25 Oct 2019 16:26:32 +0000 (-0500) Subject: ceph-daemon: fix enable with conflicting ceph.target files X-Git-Tag: v15.1.0~1158^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=efd3497d03c6724e374ead5cef6c1afc0d2d7a14;p=ceph.git ceph-daemon: fix enable with conflicting ceph.target files + make description better Signed-off-by: Sage Weil --- diff --git a/src/ceph-daemon b/src/ceph-daemon index 4d079199bec7..34735653472f 100755 --- a/src/ceph-daemon +++ b/src/ceph-daemon @@ -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'])