X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fpackages;h=0cfdf7a93f867693247cb159940dbff2e60a30b4;hb=bdc94443b70d255996ee30cd30282f5c0f9dd59c;hp=4ebd3aebb698dd50f53a4146de1013057c84e207;hpb=6375f280f8ccaf3a48e579ea88f01dff2b63ad75;p=bootstrapfs.git diff --git a/plc.d/packages b/plc.d/packages index 4ebd3ae..0cfdf7a 100755 --- a/plc.d/packages +++ b/plc.d/packages @@ -16,7 +16,37 @@ # Be verbose set -x -#################### hack yumgroups +#################### +# +# (*) sometimes we have yum issuing errors like 'package does not match intended content' +# this means that the sha256 checksum of the downloaded pkg does not match +# the sha256 checksum advertised in filelists.xml +# if you did run 'yum clean all' on the node, +# this means that the repodata/ dir. on the server side is out of date +# forcing a createrepo should solve this +# +# (*) also sometimes the node complains that a package is not signed +# +# so there quite obviously are some corner cases that are not well handled +# hopefully the following subforms may be helpful to recover in these cases +# +# /etc/plc.d/packages clean +# performs cleanup of the yum repositories and signed-stamps +# thus forcing the next 'start' command to re-sign and re-index everything +# /etc/plc.d/packages superclean +# like 'clean', plus this will reinstall the noderepo rpms that you have, +# that is to say restart from unsigned rpms +# /etc/plc.d/packages start +# this is the usual form, it should be smart enough to only sign the packages that need to, +# and to rerun createrepo when useful +# /etc/plc.d/packages force +# same as 'start' but createrepo is run unconditionnally +# +# PS. I suspect sometimes the signing fails and the script does not notice properly +#################### + + +# helper for hacking yumgroups # if we've installed for several flavours # we create cross links in install-rpms like this one # ./onelab-f8-i386/vserver-onelab-f12-i386-5.0-6.2011.02.03.i686.rpm @@ -94,7 +124,7 @@ case "$1" in vslinks=$(find $repositories -name 'vserver*rpm' -a -type l) for vslink in $vslinks; do - [ ! -e $vslink ] && echo removing old $vslink + [ ! -e $vslink ] && { echo removing old $vslink; rm $vslink; } done for repo in $repositories; do @@ -107,6 +137,7 @@ case "$1" in link=$repo/$b if [ ! -e $link ] ; then echo "creating symlink $link towards $vsrpm" + ln -s $vsrpm $link fi done done @@ -146,6 +177,7 @@ case "$1" in fi # Or than createrepo database [ $package -nt $repository/repodata/repomd.xml ] && need_createrepo=true + [ $package -nt $repository/repodata/filelists.xml.gz ] && need_createrepo=true done if [ -n "$new_rpms" ] ; then @@ -161,6 +193,8 @@ case "$1" in --define "_gpg_name $PLC_MAIL_SUPPORT_ADDRESS" \ --resign $new_rpms && touch $new_stamps # check + # if we sign at least one package then we need to reindex + need_createrepo=true fi # Update repository index / yum metadata. @@ -191,10 +225,17 @@ case "$1" in for repository in $repositories ; do rm -rf $repository/signed-stamps rm -rf $repository/repodata - rm -rf $repository/headers find $repository -type l | xargs rm done ;; + # (use this only if you have noderepos installed) + superclean) + shift + find /var/www/html/install-rpms -name signed-stamps | xargs rm -rf + find /var/www/html/install-rpms -name repodata | xargs rm -rf + find /var/www/html/install-rpms -type l | xargs rm + rpm -aq | grep noderepo | xargs yum -y reinstall + ;; *) echo "Usage: $0 start|force|clean [repo ..]" ;;