From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 Description of problem: When yum installs a package as a result of being invoked from the cron job /etc/cron.daily/yum.cron, the output from yum is far too verbose, being targeted for an interactive terminal session instead of the email to root that it ends up in: /etc/cron.daily/yum.cron: Updating: libxml2 0 % done 1/22 Updating: libxml2 3 % done 1/22 Updating: libxml2 3 % done 1/22 Updating: libxml2 9 % done 1/22 Updating: libxml2 14 % done 1/22 Updating: libxml2 19 % done 1/22 Updating: libxml2 25 % done 1/22 Updating: libxml2 30 % done 1/22 Updating: libxml2 35 % done 1/22 Updating: libxml2 40 % done 1/22 Updating: libxml2 46 % done 1/22 Updating: libxml2 51 % done 1/22 Updating: libxml2 56 % done 1/22 Updating: libxml2 62 % done 1/22 Updating: libxml2 67 % done 1/22 Updating: libxml2 72 % done 1/22 Updating: libxml2 78 % done 1/22 Updating: libxml2 81 % done 1/22 Updating: libxml2 81 % done 1/22 Updating: libxml2 81 % done 1/22 Updating: libxml2 87 % done 1/22 Updating: libxml2 92 % done 1/22 Updating: libxml2 93 % done 1/22 Updating: libxml2 93 % done 1/22 Updating: libxml2 98 % done 1/22 Updating: libxml2 98 % done 1/22 Updating: libxml2 99 % done 1/22 Updating: libxml2 99 % done 1/22 Updating: libxml2 99 % done 1/22 Updating: libxml2 99 % done 1/22 Up! dating: libxml2 100 % done 1/22 Updating: gd 0 % done 2/22 Updating: gd 14 % done 2/22 Updating: gd 28 % done 2/22 Updating: gd 42 % done 2/22 Updating: gd 49 % done 2/22 Updating: gd 49 % done 2/22 Updating: gd 64 % done 2/22 Updating: gd 78 % done 2/22 Updating: gd 92 % done 2/22 Updating: gd 99 % done 2/22 Updating: gd 100 % done 2/22 Updating: gd-devel 1 % done 3/22 Updating: gd-devel 11 % done 3/22 Updating: gd-devel 11 % done 3/22 Updating: gd-devel 12 % done 3/22 Updating: gd-devel 12 % done 3/22 Updating: gd-devel 13 % done 3/22 Updating: gd-devel 13 % done 3/22 Updating: gd-devel 13 % done 3/22 Updating: gd-devel 13 % done 3/22 Updating: gd-devel 14 % done 3/22 Updating: gd-devel 36 % done 3/22 Updating: gd-devel 58 % done 3/22 Updating: gd-devel 80 % done 3/22 Updating: gd-devel 99 % done 3/22 Updating: gd-devel 99 % done 3/22 Updating: gd-devel 100 % done 3/22 The openoffice.org update resulted in a very large email... I would suggest either: (a) adding a command line option to run quietly, or (b) autodetecting that the output is not a terminal, and running quietly. This isn't just a cosmetic issue; having to trawl through this output means that a real error message could get missed. Version-Release number of selected component (if applicable): yum-2.1.11-3 How reproducible: Always Steps to Reproduce: Enable nightly yum updates. Wait for an update to be installed. Read email. Actual Results: Extra-verbose output from cron Expected Results: Only get mail if rpm installation generates output Additional info:
cat /etc/cron.daily/yum.cron
OK, so there's a -e 0 option that looks like the one to use. But my /etc/cron.daily/yum.cron already has it: $ cat /etc/cron.daily/yum.cron #!/bin/sh 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 And I still get the verbose output.
Are you sure that cron job is being used? Did you setup a different one, perchance? I can't replicate this on any of my systems.
No; here's the headers of the email I received yesterday morning, from a machine upgraded from FC2 to FC3 earlier this week. It appears to point the finger at /etc/cron.daily/yum.cron Received: (from root@localhost) by xy01m005.manchester.xyratex.com (8.13.1/8.13.1/Submit) id iAB4265C019480; Thu, 11 Nov 2004 04:02:06 GMT Date: Thu, 11 Nov 2004 04:02:06 GMT Message-Id: <200411110402.iAB4265C019480.xyratex.com> From: cron (Cron Daemon) To: me Subject: Cron <root@xy01m005> run-parts /etc/cron.daily X-Cron-Env: <SHELL=/bin/bash> X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin> X-Cron-Env: <MAILTO=root> X-Cron-Env: <HOME=/> X-Cron-Env: <LOGNAME=root> X-Cron-Env: <USER=root> I do have a cron job to do "yum clean packages" but it's clearly not that. There are no other mentions of yum in any file in /etc/cron.daily other than the yum.conf from comment #2. The text "/etc/cron.daily/yum.cron:" appears in the message body, as indicated in the bug report.
I can't duplicate this at all. Can you post your yum.conf just to make sure there's not something else going on maybe from there? Is it still happening for you? can you make it happen again?
I get the identical behaviour on an FC3 system I installed just last week. I did a network install (via HTTP) from a local mirror (www.muug.mb.ca), and every time cron.daily runs /etc/cron.daily/yum.cron and yum updates some packages, I get this verbose output. My yum.cron script is just like the one Paul posted in comment #2 above, and my /etc/yum.conf file has not been changed since yum-2.1.11-3 was installed. I just grabbed the yum-2.1.11-3.noarch.rpm package from the mirror site and compared the yum.conf in it to the installed one, and they're identical. An "rpm -V yum" also returns nothing. The yum.conf contains "debuglevel=2", and a "man yum.conf" says that this is the default debug level, but one would expect the -d 0 in yum.cron would override this (it did in yum 2.0.x in FC1 and FC2).
I now have three FC3 systems, all upgraded from FC2, and all of them exhibit this problem. yum.conf: [main] cachedir=/var/cache/yum debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=fedora-release tolerant=1 exactarch=1 retries=20 obsoletes=1 gpgcheck=1 # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d /etc/yum.repos.d/fedora-updates.repo: [updates-released] name=Fedora Core $releasever - $basearch - Released Updates mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever enabled=1 gpgcheck=1 I've also tried using a local repository, with baseurl= instead of the mirrorlist; same result. I can reproduce the problem at will by downgrading one of the packages for which an update has been released and running yum manually with the same parameters as in the cron job.
If it matters, yum is run using python-2.3.4-11 on FC3. I just tried downgrading jwhois to the original 3.2.2-6 package, and then I ran: yum -e 0 -d 0 -y update 2>&1 | tee /tmp/y.out which I thought would be a reasonable approximation of what run-parts does (i.e. send both stdout and stderr through a pipe). When I then run "cat -v -t -e /tmp/y.out", I get the following output... ^MUpdating: jwhois 11 % done 1/2^MUpdating: jwhois 38 % done 1/2^MUpdating: jwhois 38 % done 1/2^MUpdating: jwhois 38 % done 1/2^MUpdating: jwhois 39 % done 1/2^MUpdating: jwhois 48 % done 1/2^MUpdating: jwhois 49 % done 1/2^MUpdating: jwhois 51 % done 1/2^MUpdating: jwhois 52 % done 1/2^MUpdating: jwhois 55 % done 1/2^MUpdating: jwhois 59 % done 1/2^MUpdating: jwhois 62 % done 1/2^MUpdating: jwhois 66 % done 1/2^MUpdating: jwhois 70 % done 1/2^MUpdating: jwhois 74 % done 1/2^MUpdating: jwhois 78 % done 1/2^MUpdating: jwhois 82 % done 1/2^MUpdating: jwhois 86 % done 1/2^MUpdating: jwhois 87 % done 1/2^MUpdating: jwhois 91 % done 1/2^MUpdating: jwhois 95 % done 1/2^MUpdating: jwhois 98 % done 1/2^MUpdating: jwhois 99 % done 1/2^MUpdating: jwhois 99 % done 1/2^MUpdating: jwhois 99 % done 1/2^MUpdating: jwhois 100 % done 1/2 $ Completing update for jwhois - 2/2$ That's a lot of output for a fairly small package, despite the fact the debuglevel is set below 2 and the output is not a tty, either of which is supposed to cause the progress display to be suppressed. I also tried setting debuglevel=0 explicitly in /etc/yum.conf, and I get the same results.
okay. I've seen this behavior now and I just applied a patch to cvs to fix it. It will be fixed in 2.1.12. Thanks
Thanks, Seth. Any chance you could share the patch with us here now? I think some of us are eager to get yum to shut up.
not at the momemnt. The output your seeing is just going to stdout. You should be able to safely do > /dev/null and stderr messages will still get outputted.
Just a comment, I run the cron.daily/yum.cron set with -e 0 and -d 1. This used to give me a nice summary of updated packages: /etc/cron.daily/yum.cron: Updated: samba-client 3.0.7-2.FC1.i386 samba-common 3.0.7-2.FC1.i386 samba 3.0.7-2.FC1.i386 But no output if nothing was done. Now I get the verbose progress as reported above. I'd like any fix to be able to still allow me to get the old output. Simply sending output to /dev/null doesn't do it for me. Thanks Seth for a great program!
Created attachment 106914 [details] patch to yum to suppress vebose progress output This patch is a backport of Seth's fix in CVS, with a few changes to simplify it a tad.
I disagree that your changes in cli.py simplify it.
Created attachment 107037 [details] patch to callback.py to make the output more sane.
That patch isn't entirely complete without another one to cli.py In response to comment number 12, instead on counting on a cron report for the update you should look in /var/log/yum.log and look for the update information from there.
Any chance of an FC3 update for this, the yum service is pretty unusable without it?
I have a yum RPM containing the patch from Comment #13 that fixes the problem for me. It'll be available at http://www.city-fan.org/ftp/contrib/yum-repo/ until an official update is available.
Joe -- I'm planning to do an update of yum 2.1.12 when it's released as it has a slew of minor but nice to have fixes in it.
*** Bug 142375 has been marked as a duplicate of this bug. ***