From: Alfredo Deza Date: Tue, 2 Feb 2016 16:17:11 +0000 (-0500) Subject: [BZ-1282484] use is_upstart detection on debian init check X-Git-Tag: v1.5.32~8^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F385%2Fhead;p=ceph-deploy.git [BZ-1282484] use is_upstart detection on debian init check Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/debian/__init__.py b/ceph_deploy/hosts/debian/__init__.py index b2ece01..91b729f 100644 --- a/ceph_deploy/hosts/debian/__init__.py +++ b/ceph_deploy/hosts/debian/__init__.py @@ -2,6 +2,7 @@ import mon # noqa from install import install, mirror_install, repo_install # noqa from uninstall import uninstall # noqa from ceph_deploy.util import pkg_managers +from ceph_deploy.util.system import is_systemd, is_upstart # Allow to set some information about this distro # @@ -10,17 +11,20 @@ distro = None release = None codename = None + def choose_init(module): """ Select a init system Returns the name of a init system (upstart, sysvinit ...). """ - # fixme: newer ubuntu runs systemd - if distro.lower() == 'ubuntu': - return 'upstart' - if module.conn.remote_module.path_exists("/lib/systemd/system/ceph.target"): + if is_systemd(module.conn) or module.conn.remote_module.path_exists( + "/lib/systemd/system/ceph.target"): return 'systemd' + + if is_upstart(module.conn): + return 'upstart' + return 'sysvinit'