Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24882 - /etc/init.d/shorewall restart gives: Please use 'svc_stop; svc_start' and not 'start; stop'
Summary: /etc/init.d/shorewall restart gives: Please use 'svc_stop; svc_start' and not...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-20 05:51 UTC by Duncan Sands
Modified: 2004-11-21 02:00 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Sands 2003-07-20 05:51:14 UTC
# /etc/init.d/shorewall restart

 * Please use 'svc_stop; svc_start' and not 'start; stop' to
 * restart the service in its custom 'restart()' function.
 * Run shorewall without arguments for more info.

 * Stopping firewall...                                                        
                           [ ok ]
 * Starting firewall...
[ ok ]

Reproducible: Always
Steps to Reproduce:
1. /etc/init.d/shorewall restart

Actual Results:  
 * Please use 'svc_stop; svc_start' and not 'start; stop' to
 * restart the service in its custom 'restart()' function.
 * Run shorewall without arguments for more info.

 * Stopping firewall...                                                        
                           [ ok ]
 * Starting firewall...
[ ok ]

Expected Results:  
* Stopping firewall...                                                         
                          [ ok ]
 * Starting firewall...
[ ok ]
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-07-24 10:18:12 UTC
same error msg as #25168, which is wrong
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2004-07-02 01:36:42 UTC
*** Bug 55576 has been marked as a duplicate of this bug. ***
Comment 3 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-02 02:01:47 UTC
Bug 55576 does not seem a duplicate of this bug.
Will you change the 'start; stop' with 'stop; start' ??
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-07-08 06:22:04 UTC
You're right, it's not a duplicate, but we can handle them both in the same bug.  One problem is that runscript.sh says "start; stop" when it means "stop; start".  This is trivial but could be fixed.

The second problem is much more gross.  runscript.sh's restart case actually greps the initscript for instances of svc_stop and svc_start.  I'll try to come up with a more elegant way to handle this...  though it could just be fixed by removing the custom restart function in the shorewall init script.
Comment 5 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-08 08:03:59 UTC
Go on then :)
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2004-07-09 20:37:31 UTC
ok, I fixed both problems
Comment 7 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-10 01:37:02 UTC
Verified: in CVS.

There's a small problem: The output of the shorewall rules is shown!

-----
# /etc/init.d/shorewall restart
 * Restarting firewall...
Loading /usr/share/shorewall/functions...
Processing /etc/shorewall/params ...
Processing /etc/shorewall/shorewall.conf...
Restarting Shorewall...
Initializing...
Shorewall has detected the following iptables/netfilter capabilities:
   NAT: Available
   Packet Mangling: Available
   Multi-port Match: Available

...

-----
Comment 8 Aron Griffis (RETIRED) gentoo-dev 2004-07-10 13:42:33 UTC
I don't know anything about shorewall really, I just fixed the problem reported in this bug by putting a comment in the initscript containing the keywords that runscript.sh was grepping for.  Perhaps it would be better to remove the custom restart function entirely, then shorewall would be entirely shutdown and restarted whenever you run /etc/init.d/shorewall restart

So the question is, "Is it a problem that the rules are shown?"  If it is a problem, then I'll rip out the custom restart function from the initscript.  If it is not a problem, then... who cares?

I'll reopen this bug so that it stays on the radar for the moment.  Please respond with your opinion
Comment 9 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-10 14:39:51 UTC
In fact it shows the reule processing only when restarting, so it's not much anoying... I'll check the script and see what is missing.

By the way, 


Currently:
/etc/init.d/shorewall start   -----> /sbin/shorewall start
/etc/init.d/shorewall stop    -----> /sbin/shorewall stop
/etc/init.d/shorewall restart -----> /sbin/shorewall restart


That is NOT correct.

shorewall stop locks internet traffic from and to the interfaces. Restart does the same thing, but as it's a restart, we can say that it makes some logic.
shorewall clear clears the rules of iptables and establishes ACCEPT policies.
In my point of view, if you stop the firewall, you mean that you want to turn it off, that is, to revert to the state where there was no firewall. To achieve that:

/etc/init.d/shorewall stop -----> /sbin/shorewall clear


About the restart one, if you exec '/sbin/shorewall restart', what it does is:
'/sbin/shorewall stop; /sbin/shorewall start'. In this one, it depends on what you want to achieve. Wanna lock the connections and apply rules after that? Or do you wanna clear the rules and start the firewall over?
Comment 10 Ioannis Aslanidis (RETIRED) gentoo-dev 2004-07-10 14:42:35 UTC
By the way, 

restart()
{
ebegin "Restarting firewall"
/sbin/shorewall restart
eend $?
}

That's why the rule processing is shown. To avoid it:
/sbin/shorewall restart 1>/dev/null


One last thing, do we want 2>&1 /dev/null? Or is it ok to show processing errors? Personally I don't care.
Comment 11 Michal Suchanek 2004-07-14 04:44:54 UTC
The current restart is really bloated.
But I would rather use something like
/sbin/shorewall restart > /var/log/shorewall-restart.log

btw the firewall was designed to allow no connections when stopped so 
/etc/init.d/shorewall stop    -----> /sbin/shorewall stop
should be OK imho.
But another script action that disables the firewall would be useful.
Comment 12 SpanKY gentoo-dev 2004-10-02 23:00:03 UTC
the remaining issues are not ones with baselayout
Comment 13 Eldad Zack (RETIRED) gentoo-dev 2004-11-21 02:00:33 UTC
The behaviour of stop is wanted in a firewall, 
I've added a clear function to the init script to clear the firewall rules,
and /dev/null'd restart output.
fixed in portage...