Skip to content

Commit

Permalink
update varnish cache 4.1 yum repo setup routine
Browse files Browse the repository at this point in the history
- yum repo for varnish cache 4.1 moved hosting/urls https://community.centminmod.com/posts/54045/
- run centmin.sh menu option 23 submenu option 2 to update centmin mod, exit centmin.sh and re-run centmin.sh once to apply the automatic update switch to the new packagecloud.io hosted varnish cache 4.1 yum repo and file at /etc/yum.repos.d/varnishcache_varnish41.repo
  • Loading branch information
centminmod committed Sep 5, 2017
1 parent 415b43d commit 2344e29
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 93 deletions.
24 changes: 24 additions & 0 deletions inc/cpcheck.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
varnishfour_setup() {
if [ ! -f "$VARNISH_REPOFILE" ]; then
if [ -f /etc/yum.repos.d/varnish-4.1.repo ]; then
rm -rf /etc/yum.repos.d/varnish-4.1.repo
yum -q clean all
fi
os=centos
if [[ "$CENTOS_SEVEN" -eq '7' ]]; then
dist=7
else
dist=6
fi
VARNISH_REPOFILE='/etc/yum.repos.d/varnishcache_varnish41.repo'
yum_repo_path=$VARNISH_REPOFILE
yum_repo_config_url="https://packagecloud.io/install/repositories/varnishcache/varnish41/config_file.repo?os=${os}&dist=${dist}&source=script"
if [[ "$CENTOS_SEVEN" -eq '7' || "$CENTOS_SIX" -eq '6' ]]; then
curl -4sSf "${yum_repo_config_url}" > $yum_repo_path
yum -q makecache -y --disablerepo='*' --enablerepo='varnishcache_varnish41'
yum -q -y update varnish-release
fi
fi
}

libc_fix() {
# https://community.centminmod.com/posts/52555/
if [[ "$CENTOS_SEVEN" -eq '7' && ! -f /etc/yum/pluginconf.d/versionlock.conf && "$(rpm -qa libc-client)" = 'libc-client-2007f-16.el7.x86_64' ]]; then
Expand Down Expand Up @@ -672,6 +695,7 @@ if [[ "$INITIALINSTALL" != [yY] ]]; then
fixlibmysqlclient_symlink
mariadb_errorlogfix
libc_fix
varnishfour_setup
fi

}
Expand Down
46 changes: 4 additions & 42 deletions inc/downloads_centosseven.inc
Original file line number Diff line number Diff line change
Expand Up @@ -323,48 +323,10 @@ rpm -i ${CENTOSSEVENPERCONALRELEASEFILE}

fi

cd $DIR_TMP

if [ -s "${CENTOSSEVENVARNISHFILE}" ]; then
echo "${CENTOSSEVENVARNISHFILE} [found]"
rpm --nosignature -i ${CENTOSSEVENVARNISHFILE}
ERR=$?
CCVARNISHCHECK="$ERR"
if [ "$CCVARNISHCHECK" == '0' ]; then
sed -i 's|el6|el7|g' /etc/yum.repos.d/varnish.repo
yumpriorvarnish
echo ""
else
cecho "Error: problem with ${CENTOSSEVENVARNISHFILE} install." $boldgreen
exit $ERR
fi
else
echo "Error: ${CENTOSSEVENVARNISHFILE} not found !!! Downloading now......"
wget ${WGETOPT} ${CENTOSSEVENVARNISH} --tries=3
# wget ${WGETOPT} ${CENTOSSEVENVARNISHLOCAL} --tries=3
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: ${CENTOSSEVENVARNISHFILE} download failed." $boldgreen
FAILVARNISH='y'
checklogdetails
# exit #$ERROR
else
cecho "Download done." $boldyellow

rpm --nosignature -i ${CENTOSSEVENVARNISHFILE}
#yum -q list axel 2>&1 >/dev/null
ERR=$?
CCVARNISHCHECK="$ERR"
if [ "$CCVARNISHCHECK" == '0' ]; then
yumpriorvarnish
echo ""
else
cecho "Error: problem with ${CENTOSSEVENVARNISHFILE} install." $boldgreen
exit $ERR
fi
fi

fi
if [[ "$(uname -m)" = 'x86_64' ]]; then
varnishfour_setup
yumpriorvarnish
fi # 64bit only

####
# axivo centos 6.x 64bit only
Expand Down
45 changes: 4 additions & 41 deletions inc/downloads_centossix.inc
Original file line number Diff line number Diff line change
Expand Up @@ -323,47 +323,10 @@ rpm -i ${CENTOSSIXPERCONALRELEASEFILE}

fi

cd $DIR_TMP

if [ -s "${CENTOSSIXVARNISHFILE}" ]; then
echo "${CENTOSSIXVARNISHFILE} [found]"
rpm --nosignature -i ${CENTOSSIXVARNISHFILE}
ERR=$?
CCVARNISHCHECK="$ERR"
if [ "$CCVARNISHCHECK" == '0' ]; then
yumpriorvarnish
echo ""
else
cecho "Error: problem with ${CENTOSSIXVARNISHFILE} install." $boldgreen
exit $ERR
fi
else
echo "Error: ${CENTOSSIXVARNISHFILE} not found !!! Downloading now......"
wget ${WGETOPT} ${CENTOSSIXVARNISH} --tries=3
# wget ${WGETOPT} ${CENTOSSIXVARNISHLOCAL} --tries=3
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: ${CENTOSSIXVARNISHFILE} download failed." $boldgreen
FAILVARNISH='y'
checklogdetails
# exit #$ERROR
else
cecho "Download done." $boldyellow

rpm --nosignature -i ${CENTOSSIXVARNISHFILE}
#yum -q list axel 2>&1 >/dev/null
ERR=$?
CCVARNISHCHECK="$ERR"
if [ "$CCVARNISHCHECK" == '0' ]; then
yumpriorvarnish
echo ""
else
cecho "Error: problem with ${CENTOSSIXVARNISHFILE} install." $boldgreen
exit $ERR
fi
fi

fi
if [[ "$(uname -m)" = 'x86_64' ]]; then
varnishfour_setup
yumpriorvarnish
fi # 64bit only

####
# axivo centos 6.x 64bit only
Expand Down
20 changes: 10 additions & 10 deletions inc/yumpriorities.inc
Original file line number Diff line number Diff line change
Expand Up @@ -398,29 +398,29 @@ fi # repo file check
}

yumpriorvarnish() {
if [ -f /etc/yum.repos.d/varnish.repo ]; then
cp -p /etc/yum.repos.d/varnish.repo /etc/yum.repos.d/varnish.OLD
if [ -n "$(grep ^priority /etc/yum.repos.d/varnish.repo)" ]
if [ -f "$VARNISH_REPOFILE" ]; then
cp -p "$VARNISH_REPOFILE" /etc/yum.repos.d/varnishcache_varnish41.OLD
if [ -n "$(grep ^priority /etc/yum.repos.d/varnishcache_varnish41.repo)" ]
then
#echo priorities already set for varnish.repo
#echo priorities already set for varnishcache_varnish41.repo
PRIOREXISTS=1
else
echo "setting yum priorities for varnish.repo"
ex -s /etc/yum.repos.d/varnish.repo << EOF
:/\[rpmforge\]/ , /gpgcheck/
echo "setting yum priorities for varnish-4.1.repo"
ex -s /etc/yum.repos.d/varnishcache_varnish41.repo << EOF
:/\[varnishcache_varnish41\]/ , /gpgcheck/
:a
priority=2
.
:w
:q
EOF

sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/varnish.repo
# sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/varnishcache_varnish41.repo

cecho "*************************************************" $boldgreen
cecho "Fixing varnish.repo YUM Priorities" $boldgreen
cecho "Fixing varnishcache_varnish41.repo YUM Priorities" $boldgreen
cecho "*************************************************" $boldgreen
cat /etc/yum.repos.d/varnish.repo
cat /etc/yum.repos.d/varnishcache_varnish41.repo
echo ""
fi
fi # repo file check
Expand Down

0 comments on commit 2344e29

Please sign in to comment.