From: Sage Weil Date: Tue, 4 Aug 2015 17:30:50 +0000 (-0400) Subject: hosts/fedora: systemd only for fc22 or later X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Fwip-systemd-fchack;p=ceph-deploy.git hosts/fedora: systemd only for fc22 or later Signed-off-by: Sage Weil --- diff --git a/ceph_deploy/hosts/fedora/__init__.py b/ceph_deploy/hosts/fedora/__init__.py index 05f2192..d3ac8d9 100644 --- a/ceph_deploy/hosts/fedora/__init__.py +++ b/ceph_deploy/hosts/fedora/__init__.py @@ -18,7 +18,10 @@ def choose_init(): Returns the name of a init system (upstart, sysvinit ...). """ - return 'systemd' + if module.normalized_release.int_major >= 22: + return 'systemd' + else: + return 'sysvinit' def get_packager(module): diff --git a/ceph_deploy/hosts/fedora/mon/create.py b/ceph_deploy/hosts/fedora/mon/create.py index 139e00e..00eb7f9 100644 --- a/ceph_deploy/hosts/fedora/mon/create.py +++ b/ceph_deploy/hosts/fedora/mon/create.py @@ -6,33 +6,50 @@ def create(distro, args, monitor_keyring): hostname = distro.conn.remote_module.shortname() common.mon_create(distro, args, monitor_keyring, hostname) - # enable ceph target for this host (in case it isn't already enabled) - remoto.process.run( - distro.conn, - [ - 'systemctl', - 'enable', - 'ceph.target' - ], - timeout=7, - ) + init = choose_init() + if init == 'systemd': + # enable ceph target for this host (in case it isn't already enabled) + remoto.process.run( + distro.conn, + [ + 'systemctl', + 'enable', + 'ceph.target' + ], + timeout=7, + ) - # enable and start this mon instance - remoto.process.run( - distro.conn, - [ - 'systemctl', - 'enable', - 'ceph-mon@{hostname}'.format(hostname=hostname), - ], - timeout=7, - ) - remoto.process.run( - distro.conn, - [ - 'systemctl', - 'start', - 'ceph-mon@{hostname}'.format(hostname=hostname), - ], - timeout=7, - ) + # enable and start this mon instance + remoto.process.run( + distro.conn, + [ + 'systemctl', + 'enable', + 'ceph-mon@{hostname}'.format(hostname=hostname), + ], + timeout=7, + ) + remoto.process.run( + distro.conn, + [ + 'systemctl', + 'start', + 'ceph-mon@{hostname}'.format(hostname=hostname), + ], + timeout=7, + ) + + elif init == 'sysvinit': + service = distro.conn.remote_module.which_service() + remoto.process.run( + distro.conn, + [ + service, + 'ceph', + '-c', + '/etc/ceph/{cluster}.conf'.format(cluster=args.cluster), + 'start', + 'mon.{hostname}'.format(hostname=hostname) + ], + timeout=7, + )