[CentOS] yum check-updates script not working correctly
Leonard den Ottolander
leonard at den.ottolander.nl
Thu May 26 16:17:13 UTC 2011
Hello Brian,
On Tue, 2011-05-24 at 18:52 -0400, brian wrote:
> if [ -f /var/lock/subsys/yum ]; then
>
> if [ ${CHECKONLY} = "yes" ];then
>
> /usr/bin/yum-check
> fi
> else
> /usr/bin/yum -R 10 -e 0 -d 0 -y update yum
> /usr/bin/yum -R 120 -e 0 -d 0 -y update
> fi
> in /etc/sysconfig/yum-check:
> ---------------------- yum-check -------------------------
> # yes sets yum to check for updates and mail only if patches are available
> # no does enable autoupdate if /var/lock/subsys/yum is available
> CHECKONLY="yes"
Seems like poor logic nesting if you read the comment above. Auto update
should only happen if both $CHECKONLY is set to "no"
*and* /var/lock/subsys/yum is a file.
if [ $CHECKONLY == "yes" ]; then
/usr/bin/yum-check
else
if [ -f /var/lock/subsys/yum ]; then
/usr/bin/yum -R 10 -e 0 -d 0 -y update yum
/usr/bin/yum -R 120 -e 0 -d 0 -y update
fi
fi
is how this should read according to that comment. If you set CHECKONLY
to "no" you still have to touch /var/lock/subsys/yum to actually have
yum autoupdate.
Regards,
Leonard.
--
mount -t life -o ro /dev/dna /genetic/research
More information about the CentOS
mailing list