Bug #23781
closedceph-detect-init still uses python's platform lib
0%
Description
When 'ceph-detect-init --default sysvinit' is called on a modern system that uses /etc/os-release it will return 'sysvinit' due to a ('','','') return from 'platform.linux_distribution'
See deprecation message here:
https://bugs.python.org/issue1322
This has the following effect:
The initial call mentioned above is used in ceph-disk's 'init_get()' function which in turn is responsible for detecting and then writing a identifier file during the osd preparation.
On a /etc/os-release distro this will result in:
data4:~ # ls /var/lib/ceph/osd/ceph-13/sysvinit
/var/lib/ceph/osd/ceph-13/sysvinit
Where on a systemd system there should be a:
data1@12SP3:~ # ls /var/lib/ceph/osd/ceph-6/systemd
/var/lib/ceph/osd/ceph-6/systemd
That again gets read by ceph-disks activate call which identifies the system as a 'initV' system and calls:
'/usr/sbin/service ceph --cluster ceph start osd.$ID'
instead of 'systemctl start ceph-osd@$ID'
which of course fails.
It's hard to notice in the first place because the initial deployment activates the disk correctly, which will present you with a running cluster. Only after rebooting a node the OSDs will no longer activate their services.
A proper(python3+) fix would be to rewrite the 'ceph-detect-init' script using the proposed 'python-distro' lib.