From 57352c25767574a8d12b8553bbfcd595add1374a Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Mon, 11 Nov 2019 15:00:26 +0100 Subject: [PATCH] mirrorlist: make restart conditions proto based The new mirrorlist containers are no longer using the pkl file. The script still based all its restart and copy decisions on the pkl file. This changes all occurrences of pkl with proto. Signed-off-by: Adrian Reber --- .../files/restart-mirrorlist-containers | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/mirrormanager/mirrorlist_proxy/files/restart-mirrorlist-containers b/roles/mirrormanager/mirrorlist_proxy/files/restart-mirrorlist-containers index 5bc4df78fa..e15c7b8e84 100644 --- a/roles/mirrormanager/mirrorlist_proxy/files/restart-mirrorlist-containers +++ b/roles/mirrormanager/mirrorlist_proxy/files/restart-mirrorlist-containers @@ -15,19 +15,19 @@ TIME_DISABLE=5 ## -# Initial expected state is mirrorlist1 running, mirrorlist2 running and new pkl +# Initial expected state is mirrorlist1 running, mirrorlist2 running and new protobuf file if [ ! -f /srv/mirrorlist/data/mirrorlist2/global_netblocks.txt ]; then cp /srv/mirrorlist/data/mirrorlist1/* /srv/mirrorlist/data/mirrorlist2/ fi -## Check that pkl is newer than old pkl -if [ /srv/mirrorlist/data/mirrorlist1/mirrorlist_cache.pkl -nt /srv/mirrorlist/data/mirrorlist2/mirrorlist_cache.pkl ]; then - # new pkl +## Check that the new protobuf file is newer than old protobuf file +if [ /srv/mirrorlist/data/mirrorlist1/mirrorlist_cache.proto -nt /srv/mirrorlist/data/mirrorlist2/mirrorlist_cache.proto ]; then + # new proto : else - # No new pkl + # No new proto exit 0 fi ## check mirrorlist1 running @@ -37,7 +37,7 @@ if [ `systemctl show mirrorlist1 -p ActiveState` != 'ActiveState=active' ]; then exit 1 fi -# check mirrorlist2 (old pkl and see that it's processing ok) +# check mirrorlist2 (old proto and see that it's processing ok) curl -q -H mirrors.fedoraproject.org ${mirrorlist2} -s -f --retry 50 --retry-delay 10 --retry-connrefused --retry-max-time 180 | grep "sha512" >/dev/null if [ $? != 0 ]; then echo "ERROR: mirrorlist2 not processing correctly" @@ -51,7 +51,7 @@ sleep ${TIME_DRAIN} echo "disable server mirror-lists-backend/mirrorlist-local1" | nc -U /var/run/haproxy-admin >& /dev/null sleep ${TIME_DISABLE} -# restart mirrorlist1 (new pkl and make sure it's processing ok) +# restart mirrorlist1 (new proto and make sure it's processing ok) systemctl restart mirrorlist1 sleep ${TIME_RESTART} @@ -65,7 +65,7 @@ fi echo "enable server mirror-lists-backend/mirrorlist-local1" | nc -U /var/run/haproxy-admin >& /dev/null sleep ${TIME_RESTART} -# copy new pkl to mirrorlist2 +# copy new proto to mirrorlist2 cp -a /srv/mirrorlist/data/mirrorlist1/* /srv/mirrorlist/data/mirrorlist2/ # Drain mirrorlist2