Bug 108048

Summary: failed start shouldn't touch(1) /var/lock/subsys/...
Product: [Retired] Red Hat Linux Reporter: Stig Hackvan <stig-redhat-bugzilla>
Component: iptablesAssignee: Thomas Woerner <twoerner>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-22 13:17:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stig Hackvan 2003-10-27 02:28:02 UTC
Description of problem:

I use a makefile in /etc/sysconfig that restarts services if their configs have
changed, using /var/lock/subsys/... as the build target and the config as the
input like so:

      /var/lock/subsys/iptables : iptables
               /etc/rc.d/init.d/iptables restart

only it doesn't work so well with the current startup scripts if there is a
config problem because the lockfile gets touched even if the init failed. 
Here's one [partial?] fix to get you started...

--- iptables~   2003-08-25 22:02:39.000000000 -0700
+++ iptables    2003-10-26 18:24:11.000000000 -0800
@@ -78,11 +78,13 @@
             for i in $chains; do iptables -t $i -Z; done
  
            echo -n $"Applying iptables firewall rules: "
+               (
                grep -v "^[[:space:]]*#" $IPTABLES_CONFIG | grep -v
'^[[:space:]]*$' | /sbin/iptables-restore -c && \
                    success || \
                    failure
-           echo
+               ) &&
            touch /var/lock/subsys/iptables
+           echo
        fi
 }

Comment 1 Thomas Woerner 2004-04-22 13:17:29 UTC
Fixed since fc1.