[Pkg-ceph-commits] [ceph] 03/08: Fixup detection of init system for ubuntu >= vivid

James Downing Page jamespage at moszumanska.debian.org
Tue Dec 8 12:04:31 UTC 2015


This is an automated email from the git hooks/post-receive script.

jamespage pushed a commit to branch experimental
in repository ceph.

commit e68f8b0020dfb6c4c1c0fbb3ceec911eb1a7c6d2
Author: James Page <james.page at ubuntu.com>
Date:   Mon Nov 30 15:23:09 2015 +0000

    Fixup detection of init system for ubuntu >= vivid
---
 .../{ceph.rbdmap.init => ceph-common.rbdmap.init}  |  0
 debian/ceph.init                                   |  1 -
 debian/patches/ceph-detect-init-ubuntu.patch       | 28 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 .../ceph_detect_init/debian/__init__.py            | 13 ++++++++++
 5 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/debian/ceph.rbdmap.init b/debian/ceph-common.rbdmap.init
similarity index 100%
rename from debian/ceph.rbdmap.init
rename to debian/ceph-common.rbdmap.init
diff --git a/debian/ceph.init b/debian/ceph.init
deleted file mode 120000
index b538109..0000000
--- a/debian/ceph.init
+++ /dev/null
@@ -1 +0,0 @@
-../src/init-ceph
\ No newline at end of file
diff --git a/debian/patches/ceph-detect-init-ubuntu.patch b/debian/patches/ceph-detect-init-ubuntu.patch
new file mode 100644
index 0000000..24a5298
--- /dev/null
+++ b/debian/patches/ceph-detect-init-ubuntu.patch
@@ -0,0 +1,28 @@
+Description: Fixup handling of init detection for newer Ubuntu releases
+Author: James Page <james.page at ubuntu.com>
+Forwarded: no
+
+--- a/src/ceph-detect-init/ceph_detect_init/debian/__init__.py
++++ b/src/ceph-detect-init/ceph_detect_init/debian/__init__.py
+@@ -9,5 +9,8 @@ def choose_init():
+     Returns the name of a init system (upstart, sysvinit ...).
+     """
+     if distro.lower() in ('ubuntu', 'linuxmint'):
+-        return 'upstart'
++        if codename >= 'vivid':
++            return 'systemd'
++        else:
++            return 'upstart'
+     return 'sysvinit'
+--- a/src/ceph-detect-init/tests/test_all.py
++++ b/src/ceph-detect-init/tests/test_all.py
+@@ -50,6 +50,9 @@ class TestCephDetectInit(testtools.TestC
+         with mock.patch('ceph_detect_init.debian.distro',
+                         'ubuntu'):
+             self.assertEqual('upstart', debian.choose_init())
++            with mock.patch('ceph_detect_init.debian.codename',
++                            'vivid'):
++                self.assertEqual('systemd', debian.choose_init())
+ 
+     def test_fedora(self):
+         with mock.patch('ceph_detect_init.fedora.release',
diff --git a/debian/patches/series b/debian/patches/series
index ed82a4b..01bcfa2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -19,3 +19,4 @@ fix-argparse-defaults.patch
 fix-cycles-arch.patch
 #vivid-does-systemd.patch
 flock-location-debian.patch
+ceph-detect-init-ubuntu.patch
diff --git a/src/ceph-detect-init/ceph_detect_init/debian/__init__.py b/src/ceph-detect-init/ceph_detect_init/debian/__init__.py
new file mode 100644
index 0000000..7209ff6
--- /dev/null
+++ b/src/ceph-detect-init/ceph_detect_init/debian/__init__.py
@@ -0,0 +1,13 @@
+distro = None
+release = None
+codename = None
+
+
+def choose_init():
+    """Select a init system
+
+    Returns the name of a init system (upstart, sysvinit ...).
+    """
+    if distro.lower() in ('ubuntu', 'linuxmint'):
+        return 'upstart'
+    return 'sysvinit'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ceph/ceph.git



More information about the Pkg-ceph-commits mailing list