Workaround potential systemd failures with a pre-upgrade

As described in the comments, there is potential for systemd to not be
able to enable services after it is upgraded until it is restarted.

I do not think we see this during puppet runs in the gate because we
disable selinux, but it can be triggered (see
I0750de9e75b63190531a3d39a5fcbb19f8e8c49e)

This is a small work-around to pre-install systemd and restart it
before doing the rest of the system upgrades

Change-Id: Ibcb27199f0ecf3b1e3d927be42112e2ebcb5cd79
This commit is contained in:
Ian Wienand 2015-09-10 16:39:07 +10:00
parent 04c2028603
commit 84e69a9dd1

View File

@ -52,14 +52,23 @@ function is_opensuse {
# Distro specific puppet installs
#
function _systemd_update {
# there is a bug (rhbz#1261747) where systemd can fail to enable
# services due to selinux errors after upgrade. A work-around is
# to install the latest version here and restart the daemon after
# it is upgraded.
yum install -y systemd
systemctl daemon-reload
}
function setup_puppet_fedora {
_systemd_update
yum update -y
# NOTE: we preinstall lsb_release to ensure facter sets
# lsbdistcodename
yum install -y redhat-lsb-core git puppet
mkdir -p /etc/puppet/modules/
# Puppet expects the pip command named as pip-python on
@ -74,7 +83,6 @@ function setup_puppet_fedora {
}
function setup_puppet_rhel7 {
local puppet_pkg="https://yum.puppetlabs.com/el/7/products/x86_64/puppetlabs-release-7-10.noarch.rpm"
# install a bootstrap epel repo to install latest epel-release
@ -91,6 +99,7 @@ EOF
yum --enablerepo=epel-bootstrap -y install epel-release
rm -f /etc/yum.repos.d/epel-bootstrap.repo
_systemd_update
yum update -y
# NOTE: we preinstall lsb_release to ensure facter sets lsbdistcodename