From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Description of problem: In case of "up2date --dry-run" the exit code stays 0, even if some packages are available for download Version-Release number of selected component (if applicable): up2date-4.2.5-1 How reproducible: Always Steps to Reproduce: 1. up2date --dry-run; echo $? Actual Results: # up2date --dry-run ; echo $? Fetching package list for channel: rhel-i386-es-3... ######################################## Fetching Obsoletes list for channel: rhel-i386-es-3... Fetching rpm headers... ######################################## Name Version Rel ---------------------------------------------------------- ethereal 0.10.0a 0.30E.1 i386 Testing package set / solving RPM inter-dependencies... ######################################## Name Version Rel ---------------------------------------------------------- ethereal 0.10.0a 0.30E.1 i386 0 Expected Results: Exit code != 0 Additional info: A different exit code would be very useful in case keeping amount of messages low if "up2date --dry-run" output is sent per e-mail. Let assume following script triggered by cron: mktemp tempfile up2date >tempfile if [ $? -ne 0 ]; then cat tempfile | mail -s "up2date causes new work for the admin" admin fi rm -f tempfile
Internal RFE bug #114597 entered. Will be considered for future releases.
Then it should not be in MODIFIED state. Back to ASSIGNED
It's been 2 years now and the bug is still present in RHEL4....that's pretty weak you guys. Switching distributions sounds more and more like a good idea to me. Sorry to bitch but I've hit quite a few of those bugs that seem to survive ages and ages and every time I encounter one RH support points me to a page like this where I can find out that this bug first appeared in RHEL3... Is this one really so hard to fix ? Exiting with the correct code as it is described in the man page should be a standard and NOT a "feature". I understand that bugs appear but 2 years and nothing ?? It's just very frustrating so here I am venting !!!
up2date's man page says the following about return code: RETURN CODES Update Agent returns 0 on success, 1 on error. I'm not sure where your expectations came from, but the update agent is behaving as designed.
You're right, it currently works as designed, so this is more a request for enhancement to return a different exit code, if "--dry-run" is used and packages are available for update. Sure, administrators are happy about that. BTW: yum does a better job on this issue, see here my current "check for updates" script: # Check for available updates if [ -x /usr/bin/yum ]; then /usr/bin/yum -e 0 -d 0 check-update fi if [ -x /usr/sbin/up2date ]; then OUTPUT="`/usr/sbin/up2date --dry-run`" retval=$? if [ `echo "$OUTPUT" | grep -m 1 -A 1 "^--------" | wc -l` -gt 1 -o $retval -ne 0 ]; then echo "$OUTPUT" fi fi
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. Please See https://access.redhat.com/support/policy/updates/errata/ If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.