try to fix mirrormanager problem and make it easier to see why there was a problem in future. [magic variables suck]

This commit is contained in:
Stephen Smoogen 2018-07-21 19:51:23 +00:00
parent 92ad26aea9
commit a5b08dde59

View file

@ -4,6 +4,13 @@
# This job handles hourly restarting mirrorlist container(s) and making sure all is well.
#
##
## Docker ports for mirrors
mirrorlist1="http://localhost:18081/metalink?repo=rawhide&arch=x86_64"
mirrorlist2="http://localhost:18081/metalink?repo=rawhide&arch=x86_64"
##
# Initial expected state is mirrorlist1 running, mirrorlist2 running and new pkl
if [ ! -f /srv/mirrorlist/data/mirrorlist2/global_netblocks.txt ];
@ -27,10 +34,11 @@ if [ `systemctl show mirrorlist1 -p ActiveState` != 'ActiveState=active' ]; then
fi
# start mirrorlist2 (old pkl and see that it's processing ok)
systemctl start mirrorlist2
sleep 40
curl -q -H mirrors.fedoraproject.org "http://localhost:18082/metalink?repo=rawhide&arch=x86_64" -s -f --retry 50 --retry-delay 10 --retry-connrefused --retry-max-time 180 | grep "sha512" >/dev/null
sleep 5
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 did not start correctly"
exit 1
@ -47,7 +55,7 @@ sleep 1
systemctl restart mirrorlist1
sleep 5
curl -q -H mirrors.fedoraproject.org "http://localhost:18082/metalink?repo=rawhide&arch=x86_64" -s -f --retry 50 --retry-delay 10 --retry-connrefused --retry-max-time 180 | grep "sha512" >/dev/null
curl -q -H mirrors.fedoraproject.org ${mirrorlist1} -s -f --retry 50 --retry-delay 10 --retry-connrefused --retry-max-time 180 | grep "sha512" >/dev/null
if [ $? != 0 ]; then
echo "ERROR: mirrorlist1 did not restart correctly"
exit 1
@ -70,7 +78,7 @@ sleep 1
systemctl restart mirrorlist2
sleep 5
curl -q -H mirrors.fedoraproject.org "http://localhost:18082/metalink?repo=rawhide&arch=x86_64" -o/dev/null -s -f --retry 50 --retry-delay 10 --retry-connrefused --retry-max-time 180
curl -q -H mirrors.fedoraproject.org ${mirrorlist2} -o/dev/null -s -f --retry 50 --retry-delay 10 --retry-connrefused --retry-max-time 180
if [ $? != 0 ]; then
echo "ERROR: mirrorlist2 did not restart correctly"
exit 1