From 2c9575a37d5a4d0b85be83676f2dc70832c3680d Mon Sep 17 00:00:00 2001 From: Owen Synge Date: Wed, 11 Feb 2015 18:18:05 +0100 Subject: [PATCH] Support ceph cluster names with systemd Systemd unit files could only ever support one cluster name due to not supporting dynamically gathered variables. For this reason we support multiple systemd units for different cluster names. Signed-off-by: Owen Synge (cherry picked from commit 28fb607cadb8cfa438ecd9d53accafef8a73089b) (cherry picked from commit 8e011aa19384bcfe12c5aee9949019bb739110cc) --- src/ceph-disk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ceph-disk b/src/ceph-disk index e420598ce15f4..9e9242dd9c29a 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -2059,18 +2059,23 @@ def start_daemon( ], ) elif os.path.exists(os.path.join(path, 'systemd')): + cname = "" + if cluster != "ceph": + cname = "%s-" % (cluster) command_check_call( [ 'systemctl', 'enable', - 'ceph-osd@{osd_id}'.format(osd_id=osd_id), + 'ceph-{cname}osd@{osd_id}'.format(osd_id=osd_id, + cname=cname), ], ) command_check_call( [ 'systemctl', 'start', - 'ceph-osd@{osd_id}'.format(osd_id=osd_id), + 'ceph-{cname}osd@{osd_id}'.format(osd_id=osd_id, + cname=cname), ], ) else: -- 2.39.5