Bug 1473083

Summary: Running wget without option -b in the background will yield a file 'wget-log'
Product: [Fedora] Fedora Reporter: Adri Verhoef <bugzilla>
Component: wgetAssignee: Tomáš Hozza <thozza>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: bugzilla, micah, thozza
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-23 11:40:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adri Verhoef 2017-07-20 01:35:31 UTC
Description of problem:
On Fedora 25, running wget (without option -b) in the background doesn't yield a file wget-log, however, since Fedora 26, running wget (without option -b) in the background is 'suddenly' yielding a file wget-log.
According to the manpage, when the option -b is specified and "If no output file is specified via the -o, output is redirected to wget-log."
So, without option -b, the file wget-log should not be created (but now it does on Fedora 26).

Version-Release number of selected component (if applicable):
wget-1.19.1-3.fc26.x86_64

How reproducible:
By running wget in the background without option -b.

Steps to Reproduce:
1. The other way around ...
$ wget -b -q nu.nl
Continuing in background, pid 28969.

[This should create a file wget-log, but it doesn't.  On Fedora 25, it does.
According to the manpage, when the option -b is specified (without option -o), output is redirected to wget-log.]

2.
$ wget -q nu.nl &
[1] 28976

Redirecting output to ‘wget-log’.

[This should not create a file wget-log, for the option -b is lacking, but it does.  On Fedora 25, it doesn't.]

Actual results:
When -b is lacking and wget runs in the background, the file wget-log is created.

Expected results:
When -b is lacking and wget runs in the background, the file wget-log should not be created.

Additional info:
From the manpage:
       -b
       --background
           Go to background immediately after startup.  If no output file is specified via the -o, output is redirected to wget-log.

Comment 1 Tomáš Hozza 2017-08-23 11:40:06 UTC
Hello.

Thank you for your report.

(In reply to Adri Verhoef from comment #0)
> Description of problem:
> On Fedora 25, running wget (without option -b) in the background doesn't
> yield a file wget-log, however, since Fedora 26, running wget (without
> option -b) in the background is 'suddenly' yielding a file wget-log.
> According to the manpage, when the option -b is specified and "If no output
> file is specified via the -o, output is redirected to wget-log."
> So, without option -b, the file wget-log should not be created (but now it
> does on Fedora 26).
> 
> Version-Release number of selected component (if applicable):
> wget-1.19.1-3.fc26.x86_64
> 
> How reproducible:
> By running wget in the background without option -b.
> 
> Steps to Reproduce:
> 1. The other way around ...
> $ wget -b -q nu.nl
> Continuing in background, pid 28969.
> 
> [This should create a file wget-log, but it doesn't.  On Fedora 25, it does.
> According to the manpage, when the option -b is specified (without option
> -o), output is redirected to wget-log.]

I can not reproduce this on Fedora 25. wget-log is not created on F25 nor on F26. The behavior seems to be consistent. If I remove "-q", wget-log is created on both, F25 and F26.

Tested with:
wget-1.18-3.fc25.x86_64
wget-1.19.1-3.fc26.x86_64

> 2.
> $ wget -q nu.nl &
> [1] 28976
> 
> Redirecting output to ‘wget-log’.
> 
> [This should not create a file wget-log, for the option -b is lacking, but
> it does.  On Fedora 25, it doesn't.]

This is expected. In 1.19, wget was enhanced to figure out if it is running in background automatically, so that it does not print any output on STDOUT.

You can find more info in:
http://git.savannah.gnu.org/cgit/wget.git/commit/?id=dd5c549f6af8e1143e1a6ef66725eea4bcd9ad50
https://savannah.gnu.org/bugs/?45790

> Actual results:
> When -b is lacking and wget runs in the background, the file wget-log is
> created.
> 
> Expected results:
> When -b is lacking and wget runs in the background, the file wget-log should
> not be created.
> 
> Additional info:
> From the manpage:
>        -b
>        --background
>            Go to background immediately after startup.  If no output file is
> specified via the -o, output is redirected to wget-log.

The "-b" option says that because wget is explicitly run in background, the output will go into wget-log. It does not say that if wget is run in background without the option, that it won't create wget-log. Since the fact if wget is run in the background is figured out automatically, wget-log is created if needed, without "-b" being specified.

Comment 2 Adri Verhoef 2017-08-23 12:28:12 UTC
OK, so the behaviour has changed, I understand that.  Then this is not the problem I'm running into.  Since the bugreport is closed now and the problem I'm having is when running wget in combination with -O, I'll file a new bugreport.

Comment 3 Adri Verhoef 2017-08-23 12:28:33 UTC
Thanks. :-)