Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Running service iptables (start|stop|restart) isn't displaying the usual [FAILED]|[SUCCESS] messages I'm used to on previous machines. This is a new server, but I've updated everything via yum (I'm running CentOS 6.2). This isn't really a problem, per se, but it's slightly bugging me. Anyone know what's up?

EDIT: Also, it seems I don't have an /etc/sysconfig/iptables This is strange.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

What you are seeing is normal for the case of a missing /etc/sysconfig/iptables file. If you check the $? exit code for service iptables start | restart it will be 6

# Do not start if there is no config file.
[ ! -f "$IPTABLES_DATA" ] && return 6

The stop function subsequently has nothing to do so just exit's with 0

# Do not stop if iptables module is not loaded.
[ ! -e "$PROC_IPTABLES_NAMES" ] && return 0

So it's all good.

share|improve this answer
    
Well, I imported a /etc/sysconfig/iptables from one of my other servers, and like you said, that fixed it. Green checkmark for you! Thanks! However, isn't iptables supposed to manually generate that? Any idea why it didn't? –  Rob Jul 8 '12 at 8:46
add comment

strace service iptables, getenforce to see the SELinux and id to check you are root

share|improve this answer
    
or you could just read the /etc/init.d/iptables script and see what's happening. –  Iain Jul 8 '12 at 8:10
1  
I'd go /bin/bash -x before I launched straight into strace. –  womble Jul 8 '12 at 8:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.