From 84e69a9dd18056e49a3255c3813b059e1bdd1d87 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 10 Sep 2015 16:39:07 +1000 Subject: [PATCH] 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 --- install_puppet.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/install_puppet.sh b/install_puppet.sh index 8227177396..dfb671a956 100755 --- a/install_puppet.sh +++ b/install_puppet.sh @@ -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