Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 332507 - firehol doesn't report error output
Summary: firehol doesn't report error output
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-12 18:48 UTC by Tyler Montbriand
Modified: 2012-04-02 20:28 UTC (History)
0 users

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


Attachments
Redirects errors to stderr where they belong. (firehol-errmsg.patch,274 bytes, patch)
2010-08-12 18:51 UTC, Tyler Montbriand
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Montbriand 2010-08-12 18:48:55 UTC
When you run firehol through the init script, it never displays any error text from failed ip commands.

Reproducible: Always

Steps to Reproduce:
1. Try and start firehol with a bad kernel config so it fails.
        /etc/init.d/firehol start
2. Now, run firehol by hand:
        /usr/sbin/firehol start

Actual Results:  
When you run the init script, you see error messages like:

ERROR   : # 1.
WHAT    : A runtime command failed to execute (returned error 2).
SOURCE  : line 17 of /etc/firehol/firehol.conf
COMMAND : /sbin/iptables -t filter -A out_world_all_c1 -m state '' --state
NEW\,ESTABLISHED -j ACCEPT
OUTPUT  :

When you run it by hand, you see:

ERROR   : # 1.
WHAT    : A runtime command failed to execute (returned error 2).
SOURCE  : line 17 of /etc/firehol/firehol.conf
COMMAND : /sbin/iptables -t filter -A out_world_all_c1 -m state '' --state
NEW\,ESTABLISHED -j ACCEPT
OUTPUT  :
iptables:  No chain/target/match by that name.

Expected Results:  
The error output should be visible from the init script too.

It turns out that the output text of the failed ip command is being written to stdout, even though the block of text prepending it is written to stderr!  Quite probably a bug or oversight.  The init system feeds stdout into /dev/null, so we never see it unless we run /usr/sbin/firehol by hand.

I've attached a patch for the firehol script which fixes this misdirection.

I've set this 'major' since it makes firehol very difficult to debug.
See http://bugs.gentoo.org/show_bug.cgi?id=310797 's lack of output --
I'd been on a wild goose chase with that bug for much longer than that bug's
been posted, "No chain/target/match by that name" would have told me exactly
where to look.
Comment 1 Tyler Montbriand 2010-08-12 18:51:16 UTC
Created attachment 242649 [details, diff]
Redirects errors to stderr where they belong.
Comment 2 Pacho Ramos gentoo-dev 2012-04-02 20:28:53 UTC
+*firehol-1.273-r2 (02 Apr 2012)
+
+  02 Apr 2012; Pacho Ramos <pacho@gentoo.org>
+  +files/firehol-1.273-log-output.patch, +firehol-1.273-r2.ebuild:
+  Add missing kernel checks (#310797 by Phil Koenig, Tom Knight, Tyler
+  Montbriand), use static and fixed RESERVED_IPS file (#332135 by Richard Gray),
+  handle errors better (#332507 by Tyler Montbriand).
+