bugGNU Wget - Bugs: bug #51181, Unexpected "Redirecting...


bug #51181: Unexpected "Redirecting output to 'wget-log'."

Submitted by:  Peter Wu <lekensteyn>
Submitted on:  Sun 04 Jun 2017 06:45:12 PM UTC  
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Closed
Release: 1.19.1Operating System: GNU/Linux
Reproducibility: Every TimeFixed Release: None
Planned Release: 1.19.3Regression: Yes
Work Required: NonePatch Included: None

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sun 31 Dec 2017 12:04:53 PM UTC, comment #5:

Thanks, applied.

Tim Ruehsen <rockdaboot>
Project Administrator
Wed 27 Dec 2017 01:08:00 PM UTC, comment #4:

I have investigated the issue, found the issue and attached a patch for it.

In the provided test case, file descriptors std{in,out,err} (/proc/self/fd/{0,1,2}) seem to refer to /dev/console. This happens even without chroot.

Peter Wu <lekensteyn>
Fri 27 Oct 2017 08:29:34 PM UTC, comment #3:

From the mailing list (21./22.5.2017):

If you use an explicit logfile (-o / --output-file), that code for
creating 'wget-log' isn't triggered.

It is a documented behavior, see 'man wget':
" -b
Go to background immediately after startup. If no output
file is specified via the -o, output is redirected to wget-log.

Maybe the implementation was buggy and didn't match the docs - and since 1.19 it has been fixed ?

Anyways, we want to keep backward compatibility and if that change breaks existing scripts, we should revert the change and change the docs (I am sure people dislike that as well ;-)).

Tim Ruehsen <rockdaboot>
Project Administrator
Fri 27 Oct 2017 05:35:16 PM UTC, comment #2:

This affects me, too. Please fix.

Sun 17 Sep 2017 07:39:45 PM UTC, comment #1:

an additional comment from a Debian user:

This has hit many and is already reported in several distributions, but not in Debian yet.

Since 1.19, when run in the background, even with --quiet, wget creates a log file wget-log in the current directory, which is normally empty.
If wget-log exists, it creates wget-log.1, and so on.

The workaround is to use -o /dev/null, but this changed behaviour breaks existing scripts and is undocumented.

Noël Köthe <nok>
Sun 04 Jun 2017 06:45:12 PM UTC, original submission:

Since upgrading to wget 1.19.1 from wget 1.18 on Arch Linux, the normal progress output is omitted and instead a "wget-log" file is created in some circumstances.

Not sure how exactly this is triggered, I can only reproduce this when starting wget in an initrd.

Steps to reproduce:
1. Create an initrd with "/init" consisting of the script below.
2. Boot the initrd, for example with:
qemu-system-x86_64 -m 1G -M pc,accel=kvm -kernel /boot/vmlinuz-linux -initrd initrd.gz -nographic -serial stdio -monitor none -append console=ttyS0

Expected output:
A status message such as:
--2017-06-04 20:38:57--
Connecting to failed: Connection refused.

Actual output:
Redirecting output to 'wget-log'.

Other information:
I triggered this problem in my bootstrap script https://github.com/Lekensteyn/archdir. Another affected user report: https://unix.stackexchange.com/q/363765/8250
It could be a regression from commit v1.18-84-gdd5c549f

export PATH=/usr/bin:/usr/sbin
/bin/busybox --install -s
ip link set lo up
mkdir /new
mount -t tmpfs none /new
cp -a /lib* /*bin /usr /etc /new/
chroot /new /usr/bin/wget -O - || :

# Power down
mkdir /proc
mount -t proc none /proc
echo > /proc/sysrq-trigger o
echo should not be reached

Peter Wu <lekensteyn>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #42734:  0001-Avoid-redirecting-output-to-file-when-tcgetpgrp-fail.patch added by lekensteyn (1KiB - text/x-patch - [PATCH] Avoid redirecting output to file when tcgetpgrp fails)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by rockdaboot (Posted a comment)
  • -unavailable- added by nok (Posted a comment)
  • -unavailable- added by nok
  • -unavailable- added by lekensteyn (Submitted the item)
  • -unavailable- added by lekensteyn

    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 31 Dec 2017 12:04:53 PM UTCrockdabootStatusConfirmed=>Fixed
      Planned ReleaseNone=>1.19.3
    Wed 27 Dec 2017 12:58:00 PM UTClekensteynAttached File-=>Added 0001-Avoid-redirecting-output-to-file-when-tcgetpgrp-fail.patch, #42734
    Fri 27 Oct 2017 08:29:34 PM UTCrockdabootStatusNone=>Confirmed
    Sun 17 Sep 2017 07:39:45 PM UTCnokCarbon-Copy-=>Added -unavailable-
    Sun 04 Jun 2017 06:45:12 PM UTClekensteynCarbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1