diff --git a/elements/base/install.d/00-ccache b/elements/base/install.d/00-ccache index 1aa5e415e..8d2c74520 100755 --- a/elements/base/install.d/00-ccache +++ b/elements/base/install.d/00-ccache @@ -1,2 +1,6 @@ #!/bin/bash + +set -eu +set -o pipefail + install-packages ccache diff --git a/elements/base/install.d/99-dkms b/elements/base/install.d/99-dkms index 44b2d4ce0..b8b7496cf 100755 --- a/elements/base/install.d/99-dkms +++ b/elements/base/install.d/99-dkms @@ -1,2 +1,6 @@ #!/bin/bash + +set -eu +set -o pipefail + install-packages dkms diff --git a/elements/base/install.d/99-up-to-date b/elements/base/install.d/99-up-to-date index 53f327c86..06231fd75 100755 --- a/elements/base/install.d/99-up-to-date +++ b/elements/base/install.d/99-up-to-date @@ -2,6 +2,7 @@ # Fully upgrade everything on the system (if the package manager knows how to # do it). -set -e +set -eu +set -o pipefail install-packages -u diff --git a/elements/cloud-init-nocloud/install.d/05-inject-local-source-data b/elements/cloud-init-nocloud/install.d/05-inject-local-source-data index 470b1da86..527dee667 100755 --- a/elements/cloud-init-nocloud/install.d/05-inject-local-source-data +++ b/elements/cloud-init-nocloud/install.d/05-inject-local-source-data @@ -1,5 +1,8 @@ #!/bin/bash +set -eu +set -o pipefail + # without these files, cloud-init will not perform stock operations such as # generating sshd hostkeys. diff --git a/elements/cloud-init-nocloud/install.d/05-set-cloud-init-sources b/elements/cloud-init-nocloud/install.d/05-set-cloud-init-sources index 681ce724d..f172b6044 100755 --- a/elements/cloud-init-nocloud/install.d/05-set-cloud-init-sources +++ b/elements/cloud-init-nocloud/install.d/05-set-cloud-init-sources @@ -1,5 +1,8 @@ #!/bin/bash +set -eu +set -o pipefail + cat > /etc/cloud/cloud.cfg.d/91-local-metadata-only.cfg < /tmp/yum-blacklist \ No newline at end of file diff --git a/elements/rhel7/pre-install.d/05-yum-repos b/elements/rhel7/pre-install.d/05-yum-repos index bad61e272..f0ea33aa1 100755 --- a/elements/rhel7/pre-install.d/05-yum-repos +++ b/elements/rhel7/pre-install.d/05-yum-repos @@ -1,5 +1,8 @@ #!/bin/bash +set -eu +set -o pipefail + cat << EOF > /etc/yum.repos.d/rhel7.repo [rhel7] name=RHEL7 diff --git a/elements/rpm-distro/finalise.d/11-selinux-fixfiles-restore b/elements/rpm-distro/finalise.d/11-selinux-fixfiles-restore index 6247f166b..ed094742a 100755 --- a/elements/rpm-distro/finalise.d/11-selinux-fixfiles-restore +++ b/elements/rpm-distro/finalise.d/11-selinux-fixfiles-restore @@ -1,6 +1,7 @@ #!/bin/bash -set -x +set -eux +set -o pipefail CONFIGURED_SELINUX=$(grep ^SELINUX= /etc/selinux/config | awk -F = '{print $2}') diff --git a/elements/rpm-distro/post-install.d/05-fstab-rootfs-label b/elements/rpm-distro/post-install.d/05-fstab-rootfs-label index d72670bfd..959af3fec 100755 --- a/elements/rpm-distro/post-install.d/05-fstab-rootfs-label +++ b/elements/rpm-distro/post-install.d/05-fstab-rootfs-label @@ -1,5 +1,8 @@ #!/bin/bash +set -eu +set -o pipefail + # Fedora 18 sets up for root to have a label of "_/" # Fedora 19 sets up for root to have a UUID # This regex will catch both diff --git a/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf b/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf index 78e53e18b..9bd409dd5 100755 --- a/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf +++ b/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf @@ -1,5 +1,8 @@ #!/bin/bash +set -eu +set -o pipefail + # zeroconf should not be activated or it will add a 169.254.0.0 # route. The route will interfere with access to the nova metadata # server at 169.254.169.254. diff --git a/elements/rpm-distro/pre-install.d/00-allow-heat-admin-sudo b/elements/rpm-distro/pre-install.d/00-allow-heat-admin-sudo index 4c5d5bdbf..8149d8bb2 100755 --- a/elements/rpm-distro/pre-install.d/00-allow-heat-admin-sudo +++ b/elements/rpm-distro/pre-install.d/00-allow-heat-admin-sudo @@ -1,5 +1,6 @@ #!/bin/bash -set -e +set -eu +set -o pipefail # heat-admin can not sudo without a tty by default echo 'Defaults:heat-admin !requiretty' >> /etc/sudoers.d/heat-admin-notty diff --git a/elements/rpm-distro/pre-install.d/00-allow-root-sudo b/elements/rpm-distro/pre-install.d/00-allow-root-sudo index 4736ac8a7..d6f9db97d 100755 --- a/elements/rpm-distro/pre-install.d/00-allow-root-sudo +++ b/elements/rpm-distro/pre-install.d/00-allow-root-sudo @@ -1,5 +1,6 @@ #!/bin/bash -set -e +set -eu +set -o pipefail # root can not sudo without a tty by default. echo "Defaults:root !requiretty" >> /etc/sudoers.d/root-notty diff --git a/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path b/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path index addfc0c0c..67e7a03c3 100755 --- a/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path +++ b/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path @@ -1,3 +1,6 @@ #!/bin/bash +set -eu +set -o pipefail + sed -i '/secure_path/ s/$/:\/usr\/local\/bin/' /etc/sudoers diff --git a/elements/rpm-distro/pre-install.d/01-install-bin b/elements/rpm-distro/pre-install.d/01-install-bin index 651085e1a..196b8daa1 100755 --- a/elements/rpm-distro/pre-install.d/01-install-bin +++ b/elements/rpm-distro/pre-install.d/01-install-bin @@ -1,3 +1,6 @@ #!/bin/bash +set -eu +set -o pipefail + install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin diff --git a/elements/rpm-distro/pre-install.d/01-override-yum-arch b/elements/rpm-distro/pre-install.d/01-override-yum-arch index 0e4ca66f4..78f783a16 100755 --- a/elements/rpm-distro/pre-install.d/01-override-yum-arch +++ b/elements/rpm-distro/pre-install.d/01-override-yum-arch @@ -1,5 +1,8 @@ #!/bin/bash +set -e +set -o pipefail + if [ "i386" = "$ARCH" ]; then basearch=i386 arch=i686 diff --git a/elements/selinux-permissive/install.d/11-selinux-permissive b/elements/selinux-permissive/install.d/11-selinux-permissive index a08f9bb17..8b074c168 100755 --- a/elements/selinux-permissive/install.d/11-selinux-permissive +++ b/elements/selinux-permissive/install.d/11-selinux-permissive @@ -1,5 +1,8 @@ #!/bin/bash +set -eu +set -o pipefail + echo "SELINUX=permissive" > /etc/selinux/config echo "SELINUXTYPE=targeted" >> /etc/selinux/config diff --git a/elements/stable-interface-names/install.d/02-stable-interface-names b/elements/stable-interface-names/install.d/02-stable-interface-names index fd493d487..6cfa587ca 100755 --- a/elements/stable-interface-names/install.d/02-stable-interface-names +++ b/elements/stable-interface-names/install.d/02-stable-interface-names @@ -1,5 +1,8 @@ #!/bin/bash +set -eu +set -o pipefail + # remove softlink to /dev/null which disables these rules NET_NAME_SLOT_FILE="/etc/udev/rules.d/80-net-name-slot.rules" if [ -h $NET_NAME_SLOT_FILE ]; then diff --git a/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index b/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index index c785802b8..bc039d4e3 100755 --- a/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index +++ b/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index @@ -1,4 +1,8 @@ #!/bin/bash + +set -eu +set -o pipefail + # This package is broken and causes real issues on update: # https://bugs.launchpad.net/ubuntu/+source/apt-xapian-index/+bug/1227420 apt-get --yes remove apt-xapian-index || :