Messages produced by anacron when it completes a job are not being produced correctly. Instead, the message says: Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and LINES environment variables didn't work. The resize program didn't work. The stty program didn't work. at /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Term/ReadKey.pm line 451. So far as I can tell anacron is completing the jobs defined in anacrontab, it is just the reporting of the results that is not functioning correctly. Messages from msec and from cron jobs set up using crontab-e are OK. Reproducible: Steps to Reproduce:
More investigation indicates that the problem may lie with one of commands in /etc/cron.daily and not with anacron. After I installed rkhunter, it's output is properly included in the message from anacron (after the message that I quoted above). I'm closing this bug as invalid until I've completed some more tests.
Status: NEW => RESOLVEDResolution: (none) => INVALID
To complete this report - the message quoted was caused by /etc/cron.daily/google-chrome. The only useful function that script performs is to set up the google-chrome repo in urpmi.cfg. Once that is done, I believe it is redundant. I deleted the script and the message no longer appears in anacron emails.
I encoutered it from /usr/lib/perl5/vendor_perl/5.20.1/x86_64-linux-thread-multi/Term/ReadKey.pm (perl-Term-ReadKey-2.320.0-4.mga5) line 451 It looks likes it actually comes from the resize command which can't guess the column & row numbers... when called from in a non interactive context (crond) i am not sure what is the correct fix. Probably not calling resize when not in interactive mode. At least not displaying an error message. My temporary workaround is to comment the offending lines # warn "Unable to get Terminal Size." # . join( "", map( " The $_ didn't work.", @fail ) ); My .02â¬
CC: (none) => boulshet
Resolution: INVALID => (none)Status: RESOLVED => REOPENED
Summary: Reports from anacron are not readable => Reports from cron are not readable "Unable to get Terminal Size"
As I said on the mailing list, I have a cron job that notifies me of available updates: #!/bin/sh urpmi.update -q --update urpmq --auto-select -f and after I upgraded to mga5 started to sending me those messages. For the time being I added COLUMNS and LINES to the script, but maybe commands that can be run non-interactively shouldn't use perl-Term-Readkey
Whiteboard: (none) => MGA5TOOCC: (none) => luca
My msec jobs also report this error since I upgraded to Mageia 5.
CC: (none) => mace.christophe
I've got nearly the same context as Luca reported in Comment 4. A cron job the installs updates via urpmi via cron and the problem started after upgrading to MGA5-32. That problem is also discussed here (for Term::ReadKey) https://rt.cpan.org/Public/Bug/Display.html?id=105232 but the suggestion is again the same as Luca mentioned: "The bug is in the software that is using it and not in Term::ReadKey which, as implied by the name, requires there to be a controlling terminal." The problem was also discussed on debian mailing list https://lists.debian.org/debian-user/2015/02/msg00765.html @Luca: Is it sufficient to just declare COLUMNS and LINES to the script or must they be exported as well? Maybe you could post your complete work around?
CC: (none) => s.puch
Some further links/commentrs which might be helpful. Debian had the same problem with Term::ReadKey in a package called needrestart https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=768124 They fixed it with a patch (Add patch 07-fix-warnings-without-tty to fix Perl warnings, if no TTY is available) which could be grabbed from http://http.debian.net/debian/pool/main/n/needrestart/needrestart_1.2-8+deb8u1.debian.tar.xz I'm no perl expert, but maybe that fix could be applied to urpmi or cronie or whatever causes the problem here, too?
@Stefan, I exported them, i.e., I added these 2 lines to my script COLUMNS=80 ; export COLUMNS LINES=21; export LINES
It really seems silly to be adding Columns and Lines when there is no terminal to have any columns or line. The perl Term::ReadKey (or just Term) should be testing if there is any terminal and jumping ship if there is not. Sounds like the kind of coding which produces security bugs which should be fixed at the one point, rather than fixing the uncountable number of programs that use this.
CC: (none) => unruh
Created attachment 7411 [details] Patch for urpm/download.pm I observed the same problem when cron.daily was run by anacron. The attached patch to urpm/download,pm fixed it for me.
CC: (none) => deri
@Thierry: See the proposed patch in comment 10.
Keywords: (none) => PATCHCC: (none) => thierry.vignaud
Assigning to maintainer Shlomi Fish. There is a patch in comment 10.
Assignee: bugsquad => shlomifStatus: REOPENED => NEW
In urpmi 8.06.1-1.mga5 it is line 844 or 843 (it seems to differ on different installations) rather than 823 in patch in comment 10 that must be changed.
This report saw no action since almost five years ago, so assuming the issue got fixed with a newer version of Cronie and closing this report. Feel free to reopen if the issue persists in current cauldron or Mageia 8.
Resolution: (none) => OLDStatus: NEW => RESOLVEDCC: (none) => marja11Assignee: shlomif => pkg-bugs