From 8b943b55a4a4a1b7438f23a71da98eab37b7251e Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 26 Dec 2016 14:05:56 +0100 Subject: reproducible Debian: run odd numbered codethink nodes in the future too Signed-off-by: Holger Levsen --- TODO | 3 --- deploy_jdn | 6 +++++- hosts/codethink-sled11-arm64/etc/rc.local | 17 +++++++++++++++++ hosts/codethink-sled13-arm64/etc/rc.local | 17 +++++++++++++++++ hosts/codethink-sled15-arm64/etc/rc.local | 17 +++++++++++++++++ hosts/codethink-sled9-arm64/etc/rc.local | 17 +++++++++++++++++ update_jdn.sh | 8 ++++++++ 7 files changed, 81 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 9a398f81..53d91c35 100644 --- a/TODO +++ b/TODO @@ -226,10 +226,7 @@ The idea is to run a jenkins.d.o host, which is maintained by DSA, but we are ma ==== reproducible Debian arm64 -* bring back sled9 * squid is not used, we copy a /etc/squid3/squid3.conf but ubuntu uses /etc/squid/squid.conf -* vary the time, run half the nodes in the future -* fix regular munin warnings * remove unwanted users from buildnodes (accidently created due to buggy update_jdn) * update variations table * add arm64 to THANKS+README diff --git a/deploy_jdn b/deploy_jdn index dcd6833c..f12bbaf6 100755 --- a/deploy_jdn +++ b/deploy_jdn @@ -169,7 +169,11 @@ for i in $HOSTS ; do if $reset_clock ; then case $i in profitbricks-build4-amd64*|profitbricks-build5-amd64*|profitbricks-build6-i386*|profitbricks-build15-amd64*|profitbricks-build16-i386*) - # set correct date + # set correct future date + command="sudo ntpdate -b de.pool.ntp.org && $real_command && sudo date --set=\"+398 days +6 hours + 23 minutes\" && echo '__$(echo $i|cut -d '.' -f1)=ok__'" + ;; + codethink9*|codethink11*|codethink13*|codethink15*) + # set correct future date command="sudo ntpdate -b de.pool.ntp.org && $real_command && sudo date --set=\"+398 days +6 hours + 23 minutes\" && echo '__$(echo $i|cut -d '.' -f1)=ok__'" ;; *) diff --git a/hosts/codethink-sled11-arm64/etc/rc.local b/hosts/codethink-sled11-arm64/etc/rc.local index 1c4ece10..b3a760e4 100755 --- a/hosts/codethink-sled11-arm64/etc/rc.local +++ b/hosts/codethink-sled11-arm64/etc/rc.local @@ -13,4 +13,21 @@ echo "$(date -u) - system was rebooted" | mail -s "$(hostname -f) rebooted" root +# stop ntp +service ntp stop || true +# disable systemd date services (and don't fail if systemd ain't running) +systemctl disable systemd-timesyncd +systemctl disable systemd-timedated +systemctl stop systemd-timesyncd || true +systemctl stop systemd-timedated || true +# set correct date +ntpdate -b de.pool.ntp.org +# set fake date +date --set="+398 days +6 hours + 23 minutes" +# disable check for outdated packages as in the future (like this) +# packages from security.d.o will appear outdated always… +ln -sf /bin/true /usr/local/bin/dsa-check-packages +# finally report success +echo "$(date -u) - system is running in the future now" | mail -s "$(hostname -f) in the future" root + exit 0 diff --git a/hosts/codethink-sled13-arm64/etc/rc.local b/hosts/codethink-sled13-arm64/etc/rc.local index 1c4ece10..b3a760e4 100755 --- a/hosts/codethink-sled13-arm64/etc/rc.local +++ b/hosts/codethink-sled13-arm64/etc/rc.local @@ -13,4 +13,21 @@ echo "$(date -u) - system was rebooted" | mail -s "$(hostname -f) rebooted" root +# stop ntp +service ntp stop || true +# disable systemd date services (and don't fail if systemd ain't running) +systemctl disable systemd-timesyncd +systemctl disable systemd-timedated +systemctl stop systemd-timesyncd || true +systemctl stop systemd-timedated || true +# set correct date +ntpdate -b de.pool.ntp.org +# set fake date +date --set="+398 days +6 hours + 23 minutes" +# disable check for outdated packages as in the future (like this) +# packages from security.d.o will appear outdated always… +ln -sf /bin/true /usr/local/bin/dsa-check-packages +# finally report success +echo "$(date -u) - system is running in the future now" | mail -s "$(hostname -f) in the future" root + exit 0 diff --git a/hosts/codethink-sled15-arm64/etc/rc.local b/hosts/codethink-sled15-arm64/etc/rc.local index 1c4ece10..b3a760e4 100755 --- a/hosts/codethink-sled15-arm64/etc/rc.local +++ b/hosts/codethink-sled15-arm64/etc/rc.local @@ -13,4 +13,21 @@ echo "$(date -u) - system was rebooted" | mail -s "$(hostname -f) rebooted" root +# stop ntp +service ntp stop || true +# disable systemd date services (and don't fail if systemd ain't running) +systemctl disable systemd-timesyncd +systemctl disable systemd-timedated +systemctl stop systemd-timesyncd || true +systemctl stop systemd-timedated || true +# set correct date +ntpdate -b de.pool.ntp.org +# set fake date +date --set="+398 days +6 hours + 23 minutes" +# disable check for outdated packages as in the future (like this) +# packages from security.d.o will appear outdated always… +ln -sf /bin/true /usr/local/bin/dsa-check-packages +# finally report success +echo "$(date -u) - system is running in the future now" | mail -s "$(hostname -f) in the future" root + exit 0 diff --git a/hosts/codethink-sled9-arm64/etc/rc.local b/hosts/codethink-sled9-arm64/etc/rc.local index 1c4ece10..b3a760e4 100755 --- a/hosts/codethink-sled9-arm64/etc/rc.local +++ b/hosts/codethink-sled9-arm64/etc/rc.local @@ -13,4 +13,21 @@ echo "$(date -u) - system was rebooted" | mail -s "$(hostname -f) rebooted" root +# stop ntp +service ntp stop || true +# disable systemd date services (and don't fail if systemd ain't running) +systemctl disable systemd-timesyncd +systemctl disable systemd-timedated +systemctl stop systemd-timesyncd || true +systemctl stop systemd-timedated || true +# set correct date +ntpdate -b de.pool.ntp.org +# set fake date +date --set="+398 days +6 hours + 23 minutes" +# disable check for outdated packages as in the future (like this) +# packages from security.d.o will appear outdated always… +ln -sf /bin/true /usr/local/bin/dsa-check-packages +# finally report success +echo "$(date -u) - system is running in the future now" | mail -s "$(hostname -f) in the future" root + exit 0 diff --git a/update_jdn.sh b/update_jdn.sh index 9ad34077..aa8c8f43 100755 --- a/update_jdn.sh +++ b/update_jdn.sh @@ -38,6 +38,10 @@ case $HOSTNAME in sudo service ntp stop sudo ntpdate -b de.pool.ntp.org ;; + codethink9*|codethink11*|codethink13*|codethink15*) + # set correct date + sudo service ntp stop + sudo ntpdate -b de.pool.ntp.org *) ;; esac @@ -294,6 +298,7 @@ if [ -f /etc/debian_version ] ; then # needed to run the 2nd reproducible builds nodes in the future... case $HOSTNAME in profitbricks-build4-amd64|profitbricks-build5-amd64|profitbricks-build6-i386|profitbricks-build15-amd64|profitbricks-build16-i386) DEBS="$DEBS ntpdate" ;; + codethink9*|codethink11*|codethink13*|codethink15*) DEBS="$DEBS ntpdate" ;; *) ;; esac # needed to run coreboot/openwrt/lede/netbsd/fedora jobs @@ -757,6 +762,9 @@ case $HOSTNAME in profitbricks-build4-amd64|profitbricks-build5-amd64|profitbricks-build6-i386|profitbricks-build15-amd64|profitbricks-build16-i386) sudo date --set="+398 days +6 hours + 23 minutes" ;; + codethink9*|codethink11*|codethink13*|codethink15*) + sudo date --set="+398 days +6 hours + 23 minutes" + ;; jenkins) # notify irc on updates of jenkins.d.n MESSAGE="jenkins.d.n updated to $(cd $BASEDIR ; git describe --always)." -- cgit v1.2.3-54-g00ecf