From: Owen Synge Date: Wed, 11 Feb 2015 17:18:05 +0000 (+0100) Subject: Support ceph cluster names with systemd X-Git-Tag: SES1-maint01~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=89a94f7dbfc2345d275b0b1df1b088a4548cebdd;p=ceph.git 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) --- diff --git a/src/ceph-disk b/src/ceph-disk index 5c7959f37693..a1511ba89e82 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1872,18 +1872,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: