← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1411829] [NEW] CentOS 7 should be treated like RHEL 7 in dist/rhel.py

 

Public bug reported:

cloudinit/dists/rhel.py contains the follow code to determine if systemd
is in use:

    def uses_systemd(self):
        # Fedora 18 and RHEL 7 were the first adopters in their series
        (dist, vers) = util.system_info()['dist'][:2]
        major = (int)(vers.split('.')[0])
        return ((dist.startswith('Red Hat Enterprise Linux') and major >= 7)
                or (dist.startswith('Fedora') and major >= 18))


This will not produce the correct behavior on CentOS 7, Scientific LInux 7, or any other RHEL-based distribution.  Among other issues, this will prevent cloud-init from setting the system hostname correctly.  Because these distributions are treated like RHEL6 and earlier, cloud-init writes the persistent hostname into /etc/sysconfig/network, but the hostname is not read from this file when the system boots.

I propose that we replace uses_systemd with the following:

    def uses_systemd(self):
        return os.path.isfile('/usr/bin/systemctl')

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1411829

Title:
  CentOS 7 should be treated like RHEL 7 in dist/rhel.py

Status in Init scripts for use on cloud images:
  New

Bug description:
  cloudinit/dists/rhel.py contains the follow code to determine if
  systemd is in use:

      def uses_systemd(self):
          # Fedora 18 and RHEL 7 were the first adopters in their series
          (dist, vers) = util.system_info()['dist'][:2]
          major = (int)(vers.split('.')[0])
          return ((dist.startswith('Red Hat Enterprise Linux') and major >= 7)
                  or (dist.startswith('Fedora') and major >= 18))

  
  This will not produce the correct behavior on CentOS 7, Scientific LInux 7, or any other RHEL-based distribution.  Among other issues, this will prevent cloud-init from setting the system hostname correctly.  Because these distributions are treated like RHEL6 and earlier, cloud-init writes the persistent hostname into /etc/sysconfig/network, but the hostname is not read from this file when the system boots.

  I propose that we replace uses_systemd with the following:

      def uses_systemd(self):
          return os.path.isfile('/usr/bin/systemctl')

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1411829/+subscriptions


Follow ups

References