Package: ceph-base
Version: 10.2.5-6

ceph-detect-init currently doesn't support Debian stretch, which results to unexpected behavior.

$ /usr/sbin/ceph-detect-init
Traceback (most recent call last):
  File "/usr/sbin/ceph-detect-init", line 11, in <module>
load_entry_point('ceph-detect-init==1.0.1', 'console_scripts', 'ceph-detect-init')() File "/usr/lib/python2.7/dist-packages/ceph_detect_init/main.py", line 56, in run
    print(ceph_detect_init.get(args.use_rhceph).init)
File "/usr/lib/python2.7/dist-packages/ceph_detect_init/__init__.py", line 32, in get
    release=release)
ceph_detect_init.exc.UnsupportedPlatform: Platform is not supported.: debian 9.0


Also other ceph tools depend on this information:

May  8 10:54:33 hostname sh[685]: activate: OSD id is 4
May 8 10:54:33 hostname sh[685]: command: Running command: /usr/bin/ceph-conf --cluster=ceph --name=osd. --lookup init May 8 10:54:33 hostname sh[685]: command: Running command: /usr/sbin/ceph-detect-init --default sysvinit May 8 10:54:33 hostname sh[685]: activate: Marking with init system sysvinit

As you can see ceph assumes our init system is sysvinit in stretch, while it is systemd.

Instead of trying to do:
May 8 11:01:38 hostname sh[667]: command_check_call: Running command: /bin/systemctl enable ceph-osd@4 May 8 11:01:38 hostname sh[667]: command_check_call: Running command: /bin/systemctl start ceph-osd@4

It does stuff like:
May 8 10:54:33 hostname sh[685]: command_check_call: Running command: /usr/sbin/service ceph --cluster ceph start osd.4 May 8 10:54:33 hostname sh[685]: Running as unit: ceph-osd.4.1494233673.343410728.service


Applying this patch improved things, but I think more is needed, like integration tests etc.:

--- a/src/ceph-detect-init/ceph_detect_init/__init__.py
+++ b/src/ceph-detect-init/ceph_detect_init/__init__.py
@@ -86,6 +86,7 @@ def platform_information():
     # this could be an empty string in Debian
     if not codename and 'debian' in distro.lower():
         debian_codenames = {
+            '9': 'stretch',
             '8': 'jessie',
             '7': 'wheezy',
             '6': 'squeeze',
diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py
index 893742721..a30d4329b 100755
--- a/src/ceph-disk/ceph_disk/main.py
+++ b/src/ceph-disk/ceph_disk/main.py
@@ -454,6 +454,7 @@ def platform_information():
     # this could be an empty string in Debian
     if not codename and 'debian' in distro.lower():
         debian_codenames = {
+            '9': 'stretch',
             '8': 'jessie',
             '7': 'wheezy',
             '6': 'squeeze',

Reply via email to