Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 208317 - sys-apps/busybox nohup module doesn't behave like coreutils's nohup
Summary: sys-apps/busybox nohup module doesn't behave like coreutils's nohup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-31 16:24 UTC by Christoph Gysin
Modified: 2008-02-06 15:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
busybox-1.9.0-nohup-redirection.patch (busybox-1.9.0-nohup-redirection.patch,583 bytes, patch)
2008-01-31 16:26 UTC, Christoph Gysin
Details | Diff
busybox-1.9.0-nohup-redirection.patch (busybox-1.9.0-nohup-redirection.patch,698 bytes, patch)
2008-01-31 17:03 UTC, Christoph Gysin
Details | Diff
busybox-1.9.0-nohup-redirection.patch (nohup.c.diff,2.23 KB, patch)
2008-02-04 12:00 UTC, Christoph Gysin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Gysin 2008-01-31 16:24:51 UTC
I found a bug in busybox-1.9.0. The nohup module doesn't behave like nohup
from coreutils when it comes to output redirection.

To test all possible cases I used the following little script:

$ cat stdout-stderr
#!/bin/bash
echo stdout
echo stderr 1>&2

With this, I compared the behaviour of nohup and busybox's nohup module with
different output redirections:

$ nohup ./stdout-stderr
$ busybox nohup ./stdout-stderr
$ nohup ./stdout-stderr 1>stdout.log
$ busybox nohup ./stdout-stderr 1>stdout.log
$ nohup ./stdout-stderr 2>stderr.log
$ busybox nohup ./stdout-stderr 2>stderr.log
$ nohup ./stdout-stderr 1>stdout.log 2>stderr.log
$ busybox nohup ./stdout-stderr 1>stdout.log 2>stderr.log

After each command I checked the contents of nohup.out, stdout.log and
stderr.log. These are the results:

+-----------------++-----------------+-----------------+-----------------+
| filedescriptors ||      nohup      |     busybox     | patched busybox |
+--------+--------++--------+--------+--------+--------+--------+--------+
| stdout | stderr || stdout | stderr | stdout | stderr | stdout | stderr |
+--------+--------++--------+--------+--------+--------+--------+--------+
|  tty   |  tty   ||  file  |  file  |  file  |  file  |  file  |  file  |
|  tty   |   -    ||  file  | stderr |  file  |   -    |  file  | stderr |
|   -    |  tty   || stdout | stdout |   -    |   -    | stdout | stdout |
|   -    |   -    || stdout | stderr |   -    |   -    | stdout | stderr |
+--------+--------++--------+--------+--------+--------+--------+--------+

tested with:

$ nohup --version
nohup (GNU coreutils) 6.9

$ busybox
BusyBox v1.9.0 (2008-01-31 16:29:55 CET) multi-call binary

I also sent this bug report upstream, but until it's fixed it we should include a patch in the ebuild.


Reproducible: Always

Steps to Reproduce:
Comment 1 Christoph Gysin 2008-01-31 16:26:30 UTC
Created attachment 142295 [details, diff]
busybox-1.9.0-nohup-redirection.patch

Simple patch that fixes the problem.
Comment 2 Christoph Gysin 2008-01-31 17:03:38 UTC
Created attachment 142297 [details, diff]
busybox-1.9.0-nohup-redirection.patch

Fixes the output of the message "nohup: appending to                                      nohup.out" as well, to make it behave exactly as coreutils nohup does.
Comment 3 Christoph Gysin 2008-02-04 11:15:50 UTC
upstream fixed it in current svn:
http://article.gmane.org/gmane.linux.busybox/22449
Comment 4 Christoph Gysin 2008-02-04 12:00:27 UTC
Created attachment 142647 [details, diff]
busybox-1.9.0-nohup-redirection.patch

Patch as it was applied to busybox svn:
http://www.busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/coreutils/nohup.c?rev=20940&r1=20219&r2=20940&makepatch=1&diff_format=u
Comment 5 SpanKY gentoo-dev 2008-02-06 15:36:22 UTC
added upstream fix to 1.9.0