Bug 108048 - failed start shouldn't touch(1) /var/lock/subsys/...
failed start shouldn't touch(1) /var/lock/subsys/...
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: iptables (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-26 21:28 EST by Stig Hackvan
Modified: 2007-04-18 12:58 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-22 09:17:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stig Hackvan 2003-10-26 21:28:02 EST
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 09:17:29 EDT
Fixed since fc1.

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