From b796a45b119afb9186301a868c25a9ba70642891 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 2 Feb 2016 11:17:11 -0500 Subject: [PATCH] [BZ-1282484] use is_upstart detection on debian init check Signed-off-by: Alfredo Deza --- ceph_deploy/hosts/debian/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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' -- 2.47.3