Red Hat Bugzilla – Bug 863997
yum check-update with rhnplugin doesn't set correct exit code on error
Last modified: 2012-11-01 12:17:36 EDT
+++ This bug was initially created as a clone of Bug #802636 +++
Description of problem:
The yum man page says the following:
Implemented so you could know if your machine had any updates that needed to be applied without running it interactively. Returns exit value of 100 if there are packages available for an update. Also returns a list of the packages to be updated in list format. Returns 0 if no packages are available for update. Returns 1 if an error occurred. Running in verbose mode
also shows obsoletes."
However when system is not able to reach rhn/satellite it returns 0 instead of 1 :
# yum check-update
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating certificate-based repositories.
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:
# echo $?
It should have returned 1 instead of 0
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Edit /etc/sysconfig/rhn/update file and alter the rhn/satellite FQDN under serverURL in such a way that system is unable to reach it or unable to resolve the FQDN
3. Once it fails then execute :
spacewalk.git master: bc6db8afd41432b63ecf55835d1e1c0a99591c01
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18