-   Programming (
-   -   restart iptables from shell script hangs unitl button is pressed (

saiyen2002 10-29-2010 11:11 AM

restart iptables from shell script hangs unitl button is pressed
I am trying to restart iptables from within a shell script. I guess I am missing something very basic since I stripped the shell script down to just the iptables restart command yet still I am having problems.

What happens is that the iptabels starts the restart process but hangs at 'Unloaded iptables modules:'.

It will stay there forever until any key is pressed, after that it completes the restart.

my file looks like this



/etc/init.d/iptables restart

The output looks like the following

Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: mangle filter nat [ OK ]
Unloading iptables modules:
[ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_n[ OK ]

I am using Centos 5.4 2.6.18-164.el5. I am executing the script as root

feinbein 10-30-2010 05:17 AM

Just a dirty hack but can you try instead:


/etc/init.d/iptables stop
/etc/init.d/iptables start

saiyen2002 10-31-2010 06:39 PM

feinbein, I tried what you said, but it still hangs at unloading iptables modules.

I have noticed that this is something which is only relative to the boxes that I am working on, which is my test environment.

Iptables restarts fine within my live environment, which uses centos 5.5 instead of centos 5.4, which is my test environemnt

dive 10-31-2010 07:19 PM

Do you really _need_ to unload the modules on stop?

saiyen2002 11-01-2010 01:12 PM

What I _need_ to do is to restart the iptables.
doing that via the init script involves unloading the module.

Is there another way to do this?

All times are GMT -5. The time now is 03:29 AM.