没有任何理由为成功百胜更新导致后续wget的失败? [英] Is there any reason for a successful yum update to cause a subsequent wget to fail?

查看:330
本文介绍了没有任何理由为成功百胜更新导致后续wget的失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为CentOS 6.4的机器一个bash安装脚本。在一个全新的安装我运行到这似乎是重复性的问题,但情况是不同寻常的。

I'm working on a bash setup script for CentOS 6.4 machines. On a brand new install I'm running into an issue that seems to be reproducible, but the scenario is unusual.

设置脚本用root身份运行。第一步是运行不带选项的yum更新:

The setup script is run with root. The first step is to run yum update with no options:

yum update

这以零退出code成功完成。下一步骤是检索EPEL转速使用wget:

This completes successfully with a zero exit code. The next step is to retrieve the EPEL rpm using wget:

wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

然而,这是一贯的每个这是从运行时解析主机名时没有一个干净的安装CentOS的:

However, this is consistently failing when resolving the host name every time this is run from a clean CentOS install:

wget: unable to resolve host address "dl.fedoraproject.org"

在自然而在命令行中相继执行这些命令,任何问题都遇到了和wget能够获取EPEL转:

When executing these commands in succession from the command line however, no issues are encountered and wget is able to retrieve the EPEL rpm:

sudo yum update
sudo wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

这有什么yum的更新,可能导致DNS查询,而无需先退出脚本失败过程中发生?如果我第一次失败后,重新运行该脚本,它通过对第二次左右。

Is there anything that happens during the yum update that could cause the DNS lookup to fail without exiting the script first? If I rerun the script after the first failure, it passes on the second time around.

推荐答案

在住域名的时间的下一个实例之前,在系统上或缓存DNS服务器上过期这是可能的wget 并解决域名从权威的服务器失败的一次新的尝试。请参见 http://en.wikipedia.org/wiki/Time_to_live#DNS_records 。当然,这也有可能是缓存DNS服务器将无法访问。

It's possible when the Time to Live of the domain name expires on the system or on a cache DNS server before the next instance of wget and the next attempt to resolve the domain name from the authorative server fails. See http://en.wikipedia.org/wiki/Time_to_live#DNS_records. Of course it's also possible that the cache DNS server becomes inaccessible.

这篇关于没有任何理由为成功百胜更新导致后续wget的失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆