summaryrefslogtreecommitdiff
path: root/contrib/cirrus/packer/systemd_banish.sh
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-21 11:00:00 +0200
committerGitHub <noreply@github.com>2019-09-21 11:00:00 +0200
commite947d6354d9e154b07c34728abf3c2399b993131 (patch)
tree467636dcaf3fbd1b5d7ba2f1d368bc34d55903f1 /contrib/cirrus/packer/systemd_banish.sh
parent819b63c8de310d37a8658ee70fa3b825162a3e17 (diff)
parenta6534a7c9617047396252b66fdcd1caa49ce49d5 (diff)
downloadpodman-e947d6354d9e154b07c34728abf3c2399b993131.tar.gz
podman-e947d6354d9e154b07c34728abf3c2399b993131.tar.bz2
podman-e947d6354d9e154b07c34728abf3c2399b993131.zip
Merge pull request #3754 from cevich/latest_ubuntu
Add support for testing with the latest Ubuntu release
Diffstat (limited to 'contrib/cirrus/packer/systemd_banish.sh')
-rwxr-xr-xcontrib/cirrus/packer/systemd_banish.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/cirrus/packer/systemd_banish.sh b/contrib/cirrus/packer/systemd_banish.sh
new file mode 100755
index 000000000..396cf906c
--- /dev/null
+++ b/contrib/cirrus/packer/systemd_banish.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+set +e # Not all of these exist on every platform
+
+# This is intended to be executed on VMs as a startup script on initial-boot.
+# Alternativly, it may be executed with the '--list' option to return the list
+# of systemd units defined for disablement (useful for testing).
+
+EVIL_UNITS="cron crond atd apt-daily-upgrade apt-daily fstrim motd-news systemd-tmpfiles-clean"
+
+if [[ "$1" == "--list" ]]
+then
+ echo "$EVIL_UNITS"
+ exit 0
+fi
+
+echo "Disabling periodic services that could destabilize testing:"
+for unit in $EVIL_UNITS
+do
+ echo "Banishing $unit (ignoring errors)"
+ (
+ sudo systemctl stop $unit
+ sudo systemctl disable $unit
+ sudo systemctl disable $unit.timer
+ sudo systemctl mask $unit
+ sudo systemctl mask $unit.timer
+ ) &> /dev/null
+done