Bug 22643 - ipchains init script fails in kernel 2.4
ipchains init script fails in kernel 2.4
Status: CLOSED DUPLICATE of bug 22612
Product: Red Hat Linux
Classification: Retired
Component: ipchains (Show other bugs)
7.0
i386 Linux
low Severity low
: ---
: ---
Assigned To: Mike A. Harris
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-12-20 22:52 EST by Glen Turner
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-12-20 22:52:31 EST
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 Glen Turner 2000-12-20 22:52:29 EST
The init script /etc/rc.d/init.d/ipchains fails when Linux 2.4 is compiled
with legacy support for ipchains as a module.

$ uname -r
2.4.0-test12pre5-mpls0.700-gdt16

$ rpm -q ipchains
ipchains-1.3.10-1

The following code explicitly loads the module if it is required.

$ cd /etc/rc.d/init.d
$ rcsdiff -r1.1 -c ipchains
===================================================================
RCS file: RCS/ipchains,v
retrieving revision 1.1
diff -c -r1.1 ipchains
*** ipchains	2000/12/19 12:35:13	1.1
--- ipchains	2000/12/19 12:52:09
***************
*** 8,13 ****
--- 8,14 ----
  #
  # Script Author:	Joshua Jensen <joshua@redhat.com>
  #   -- hacked up by gafton with help from notting
+ #   -- modified for Linux 2.4 by glen.turner+linux@aarnet.edu.au
  #
  # config: /etc/sysconfig/ipchains
  
***************
*** 29,39 ****
--- 30,49 ----
  if [ "$KERNELMAJ" -eq 2 -a "$KERNELMIN" -lt 2 ] ; then
  	exit 0
  fi
+ if [ "$KERNELMAJ" -eq 2 -a "$KERNELMIN" -ge 4 ] ; then
+ 	# Linux 2.4 doesn't use IP chains, backward compatibility
+ 	# is provided with a module.
+ 	MODULAR="y"
+ fi
  
  case "$1" in
    start)
  	# don't do squat if we don't have the config file
  	if [ -f $IPCHAINS_CONFIG ]; then
+ 	    # Install module if needed
+ 	    [ "$MODULAR" == "y" ] && 
+ 	  	action "Installing IP chains kernel module:" modprobe ipchains
+ 
  	    # If we don't clear these first, we might be adding to
  	    #  pre-existing rules.
  	    action "Flushing all current rules and user defined chains:"
ipchains -F
***************
*** 58,63 ****
--- 68,76 ----
  	  success "Resetting built-in chains to the default ACCEPT policy" || \
  	  failure "Resetting built-in chains to the default ACCEPT policy"
  	echo
+ 	# Remove module if installed
+ 	[ "$MODULAR" == "y" ] && 
+ 	    action "Removing IP chains kernel module:" rmmod ipchains
  	rm -f /var/lock/subsys/ipchains
  	;;
Comment 1 Bill Nottingham 2000-12-20 22:53:14 EST

*** This bug has been marked as a duplicate of 22612 ***

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