Bug 108048 - failed start shouldn't touch(1) /var/lock/subsys/...
Summary: failed start shouldn't touch(1) /var/lock/subsys/...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: iptables
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-10-27 02:28 UTC by Stig Hackvan
Modified: 2007-04-18 16:58 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-04-22 13:17:29 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.