]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Synced with rc-scripts-0.0.1 from old repo.
authorstangrze <stangrze@pld-linux.org>
Mon, 14 Jun 1999 20:08:17 +0000 (20:08 +0000)
committerstangrze <stangrze@pld-linux.org>
Mon, 14 Jun 1999 20:08:17 +0000 (20:08 +0000)
svn-id: @362

48 files changed:
Makefile
inittab
inputrc [new file with mode: 0644]
lang.sh
rc-scripts.spec [new file with mode: 0644]
rc.d/init.d/functions
rc.d/init.d/functions-ip6
rc.d/init.d/halt
rc.d/init.d/killall
rc.d/init.d/network
rc.d/init.d/network-ip6.init [new file with mode: 0755]
rc.d/init.d/nfsfs
rc.d/init.d/random
rc.d/init.d/reboot [new file with mode: 0755]
rc.d/init.d/shutdwn [new file with mode: 0755]
rc.d/init.d/single
rc.d/init.d/tunnels-ip6.init [new file with mode: 0755]
rc.d/rc
rc.d/rc.local
rc.d/rc.serial
rc.d/rc.sysinit
src/Makefile
src/usernetctl.c
sysconfig.txt
sysconfig/network-ip6
sysconfig/network-ip6.conf
sysconfig/network-scripts/chat-ppp0.callback [new file with mode: 0644]
sysconfig/network-scripts/chat-ppp0.leased1 [new file with mode: 0644]
sysconfig/network-scripts/chat-ppp0.tpsa [new file with mode: 0644]
sysconfig/network-scripts/ifcfg-ppp0.callback [new file with mode: 0644]
sysconfig/network-scripts/ifcfg-ppp0.leased1 [new file with mode: 0644]
sysconfig/network-scripts/ifcfg-ppp0.leased2 [new file with mode: 0644]
sysconfig/network-scripts/ifcfg-ppp0.tpsa [new file with mode: 0644]
sysconfig/network-scripts/ifdown
sysconfig/network-scripts/ifdown-post
sysconfig/network-scripts/ifdown-ppp
sysconfig/network-scripts/ifdown-sl
sysconfig/network-scripts/ifup
sysconfig/network-scripts/ifup-aliases
sysconfig/network-scripts/ifup-ipx
sysconfig/network-scripts/ifup-plip
sysconfig/network-scripts/ifup-post
sysconfig/network-scripts/ifup-ppp
sysconfig/network-scripts/ifup-routes
sysconfig/network-scripts/ifup-sl
sysconfig/network-scripts/tnlcfg-icm [new file with mode: 0644]
sysconfig/tunnels-ip6.conf [new file with mode: 0644]
sysvinitfiles [new file with mode: 0644]

index a606d03cb941b5470c51ebf5560aa2c505664b36..dd527e1b35bef2688ef6fc120b36e81e060d4236 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,27 +7,29 @@ all:
        (cd src; make CFLAGS="$(CFLAGS)")
 
 install:
-       install -d $(ROOT)/etc/profile.d $(ROOT)/sbin
-       install inittab $(ROOT)/etc
-       install adjtime $(ROOT)/etc
-       install setsysfont $(ROOT)/sbin
-       install lang.sh $(ROOT)/etc/profile.d
+       mkdir -p $(ROOT)/etc/profile.d $(ROOT)/sbin
+       install -m644 inittab $(ROOT)/etc
+       install -m644 adjtime $(ROOT)/etc
+       install -m644 inputrc $(ROOT)/etc
+       install -m755 setsysfont $(ROOT)/sbin
+       install -m755 lang.sh $(ROOT)/etc/profile.d
        cp -af rc.d sysconfig ppp $(ROOT)/etc
-       install -d $(ROOT)/sbin
+       mkdir -p $(ROOT)/sbin
        mv $(ROOT)/etc/sysconfig/network-scripts/ifup $(ROOT)/sbin
        mv $(ROOT)/etc/sysconfig/network-scripts/ifdown $(ROOT)/sbin
        (cd $(ROOT)/etc/sysconfig/network-scripts; \
          ln -sf ../../../sbin/ifup . ; \
          ln -sf ../../../sbin/ifdown . )
        (cd src; make install ROOT=$(ROOT))
-       install -d $(ROOT)/var/run/netreport
+       mkdir -p /var/run/netreport
+       chmod og=rwx,o=rx /var/run/netreport
 
 tag-archive:
-       @cvs tag -F $(CVSTAG)
+       @cvs -Q tag -F $(CVSTAG)
 
 create-archive: tag-archive
        @rm -rf /tmp/initscripts
-       @cd /tmp; cvs export -r$(CVSTAG) initscripts
+       @cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) initscripts || echo GRRRrrrrr -- ignore [export aborted]
        @mv /tmp/initscripts /tmp/initscripts-$(VERSION)
        @cd /tmp; tar czSpf initscripts-$(VERSION).tar.gz initscripts-$(VERSION)
        @rm -rf /tmp/initscripts-$(VERSION)
diff --git a/inittab b/inittab
index 778edd5597ec832d3c0c833f01ab8c8e5dd02d22..c2a4d7a81cddce0e45cb6fd94618967e1b6d1250 100644 (file)
--- a/inittab
+++ b/inittab
@@ -4,7 +4,7 @@
 #
 # Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
 #               Modified for RHS Linux by Marc Ewing and Donnie Barnes
-#              Modified for PLD Linux by Wojtek ¦lusarczyk     
+#
 
 # Default runlevel. The runlevels used by PLD are:
 #   0 - halt (Do NOT set initdefault to this)
@@ -32,7 +32,7 @@ l6:6:wait:/etc/rc.d/rc 6
 ud::once:/sbin/update
 
 # Trap CTRL-ALT-DELETE
-#ca::ctrlaltdel:/sbin/shutdown -t3 -r now 
+ca::ctrlaltdel:/sbin/shutdown -t3 -r now
 
 # When our UPS tells us power has failed, assume we have a few minutes
 # of power left.  Schedule a shutdown for 2 minutes from now.
@@ -51,7 +51,8 @@ pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
 4:2345:respawn:/sbin/mingetty tty4
 5:2345:respawn:/sbin/mingetty tty5
 6:2345:respawn:/sbin/mingetty tty6
+7:2345:respawn:/sbin/mingetty tty7
+8:2345:respawn:/sbin/mingetty tty8
 
 # Run xdm in runlevel 5
-x:5:respawn:/usr/bin/X11/xdm -nodaemon
-
+#x:5:respawn:/usr/bin/X11/xdm -nodaemon
diff --git a/inputrc b/inputrc
new file mode 100644 (file)
index 0000000..b06d8b4
--- /dev/null
+++ b/inputrc
@@ -0,0 +1,3 @@
+set input-meta on
+set convert-meta off
+set output-meta on
diff --git a/lang.sh b/lang.sh
index 6233b0c8d1f3f1577a36363d632e7399ec52ca10..91eb3f683961274779926cc56a8fa29eb7a1aa8f 100755 (executable)
--- a/lang.sh
+++ b/lang.sh
@@ -1,16 +1,36 @@
 #!/bin/bash
+
 if [ -f /etc/sysconfig/i18n ]; then
-        . /etc/sysconfig/i18n
+    . /etc/sysconfig/i18n
+
+    if [ -n "$LANG" ]; then
+       export LANG
+    fi
 
-  if [ -n "$LANG" ]; then
-          export LANG
-  fi
+    if [ -n "$LC_ALL" ]; then
+       export LC_ALL
+    fi
   
-  if [ -n "$LINGUAS" ]; then
-          export LINGUAS
-  fi
+    if [ -n "$LINGUAS" ]; then
+       export LINGUAS
+    fi
   
-  if [ -n "$SYSTERM" ]; then
-          export TERM=$SYSTERM
-  fi
+    if [ -n "$SYSTERM" ]; then
+       export TERM=$SYSTERM
+    fi
+
+    # Set console font map.
+    if [ -n "$UNIMAP" ]; then
+       loadunimap $UNIMAP
+    fi
+
+    if [ -n "$SYSTERM" ] ; then
+       case $SYSTERM in
+           linux-lat)
+               LESSCHARSET=latin1
+               INPUTRC=/etc/inputrc
+               export LESSCHARSET INPUTRC
+               ;;
+       esac
+    fi
 fi
diff --git a/rc-scripts.spec b/rc-scripts.spec
new file mode 100644 (file)
index 0000000..a45d8f0
--- /dev/null
@@ -0,0 +1,125 @@
+Summary:       inittab and /etc/rc.d scripts
+Name:          rc-scripts
+Version:       0.0.1
+Copyright:     GPL
+Group:         Base
+Group(pl):     Bazowe  
+Release:       1
+Source:                %{name}-%{version}.tar.gz
+Buildroot:     /tmp/buildroot-%{name}-%{version}
+Requires:      mingetty
+Requires:      mktemp
+Requires:      modutils >= 2.1.121
+Prereq:                /sbin/chkconfig
+Obsoletes:     initscripts
+Summary(de):   inittab und /etc/rc.d Scripts
+Summary(fr):   inittab et scripts /etc/rc.d
+Summary(pl):   inittab i skrypty startowe z katalogu /etc/rc.d
+Summary(tr):   inittab ve /etc/rc.d dosyalarý
+
+%description
+This package contains the scripts use to boot a system, change run
+levels, and shut the system down cleanly. It also contains the scripts
+that activate and deactivate most network interfaces.
+
+%description -l de
+Dieses Paket enthält die Scripts, die zum Hochfahren des Systems, Ändern
+der Betriebsebene und sauberem Herunterfahren des Systems erforderlich sind.
+Außerdem enthält es die Scripts, die Netzwerkschnittstellen aktivieren und
+deaktivieren.
+
+%description -l fr
+Ce package contient les scripts utilisés pour démarrer le systéme,
+changer les niveaux d'exécution, et arréter le systéme proprement.
+Il contient aussi les scripts qui activent et désactivent la plupart
+des inetrfaces réseau.
+
+%description -l pl
+Pakiet zawiera skrypty uruchamiane przy starcie i zamykaniu systemu, a
+tak¿e przy zmianie poziomu uruchomienia. 
+
+%description -l tr
+Bu paket, sistem açmak, çalýþma düzeylerini deðiþtirmek ve sistemi düzgün bir
+þekilde kapatmak için gereken dosyalarý içerir. Ayrýca pek çok bilgisayar aðý
+arayüzlerini etkinleþtiren ya da edilginleþtiren programcýklar içerir.
+
+%prep
+%setup -q
+
+%build
+CFLAGS="$RPM_OPT_FLAGS -w" make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT/{etc,/var/{log,run/netreport}}
+
+make ROOT=$RPM_BUILD_ROOT install 
+
+install -d $RPM_BUILD_ROOT/etc/rc.d/rc{0,1,2,3,4,5,6}.d
+
+bzip2 -9 $RPM_BUILD_ROOT/usr/man/man1/*.1
+bzip2 -9 sysconfig.txt
+bzip2 sysconfig/network-scripts/ifcfg-*.*
+bzip2 sysconfig/network-scripts/chat-*.*
+
+
+%post
+for i in  halt network nfsfs random reboot single  
+ do /sbin/chkconfig --add $i
+done 
+
+%preun
+if [ $1 = 0 ]; then
+  /sbin/chkconfig --del random
+  /sbin/chkconfig --del nfsfs
+  /sbin/chkconfig --del network
+fi
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,754)
+%doc sysconfig.txt.bz2
+%doc sysconfig/network-scripts/ifcfg-*.*.bz2
+%doc sysconfig/network-scripts/chat-*.*.bz2
+
+%config(noreplace) %verify(not md5 mtime size) /etc/adjtime
+%config(noreplace) %verify(not md5 mtime size) /etc/inittab
+
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5)  /etc/sysconfig/network-ip6
+%attr(640,root,root) %config(noreplace) %verify(not size mtime md5)  /etc/sysconfig/network-ip6.conf
+
+%attr(754,root,root) %dir /etc/sysconfig/network-scripts
+%attr(644,root,root) %config /etc/sysconfig/network-scripts/ifcfg-lo
+%attr(644,root,root) %config /etc/sysconfig/network-scripts/network-*
+%attr(754,root,root) %config /etc/sysconfig/network-scripts/ifdhcpc-done
+%attr(754,root,root) %config /etc/sysconfig/network-scripts/ifup
+%attr(754,root,root) %config /etc/sysconfig/network-scripts/ifup-*
+%attr(754,root,root) %config /etc/sysconfig/network-scripts/ifdown
+%attr(754,root,root) %config /etc/sysconfig/network-scripts/ifdown-*
+
+%attr(755,root,root) /etc/rc.d/init.d/*
+%attr(755,root,root) /etc/rc.d/rc[0123456].d
+
+%attr(750,root,root) %config /etc/rc.d/rc.sysinit
+%attr(750,root,root) %config /etc/rc.d/rc.serial
+%attr(750,root,root) %config /etc/rc.d/rc
+%attr(700,root,root) %config(noreplace) %verify(not size mtime md5) /etc/rc.d/rc.local
+%attr(755,root,root) %config /etc/profile.d/lang.sh
+%attr(750,root,root) /sbin/*
+%attr(755,root,root) /bin/*
+%attr(755,root,root) /usr/sbin/usernetctl
+
+%attr(750,root,root) %dir /var/run/netreport
+%attr(750,root,root) %config /etc/ppp/*
+
+%attr(644,root, man) /usr/man/man1/*
+
+%changelog
+* Fri Mar 19 1999 PLD Team <bugs@pld.org.pl>
+  [0.0.1]
+- Full changelog in PLD's CVS.
+- First Release.
+- Package based on RedHat's initscripts-3.78.
index 336c7197cdaca86a48b693c68df64c222ea707cf..d34c5f3f109e3bfcb556722f6f8cd2554e29aa8a 100644 (file)
@@ -1,9 +1,7 @@
-#!/bin/bash
-#
 # functions    This file contains functions to be used by most or all
 #              shell scripts in the /etc/init.d directory.
 #
-# Version:     @(#) /etc/init.d/functions 1.01 26-Oct-1993
+# Version:     @(#) /etc/init.d/functions $Revision: 1.3 $ $Date: 1999/06/14 20:08:16 $
 #
 # Author:      Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
 # Hacked by:    Greg Galloway and Marc Ewing
 #
 
 # First set up a default search path.
-export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+PATH="/sbin:/usr/sbin:/bin:/usr/bin"; export PATH
 
 # Some functions to handle PLD-style messages
-show() 
-{
-       text="$*".............................................
-       echo -ne `echo $text | cut -c1-45`
-}
-
-busy() 
-{
-       echo -n "`tput setaf 6`[`tput setaf 5` BUSY `tput setaf 6`]`tput setaf 7`"
+function show {
+  text="$*".............................................
+  echo -ne `echo $text | cut -c1-45`
 }
 
-ok() 
-{
-       echo "`tput setaf 6`[`tput setaf 2` DONE `tput setaf 6`]`tput setaf 7`"
+function busy {
+  echo -ne "`tput setaf 6`[`tput setaf 5` BUSY `tput setaf 6`]`tput setaf 7`"
 }
 
-started()
-{
-       echo "`tput setaf 6`[`tput setaf 2` WORK `tput setaf 6`]`tput setaf 7`"
+function ok {
+  echo -ne "`tput setaf 6`[`tput setaf 2` DONE `tput setaf 6`]`tput setaf 7`"
 }
 
-fail() 
-{
-       echo "`tput setaf 6`[`tput setaf 1` FAIL `tput setaf 6`]`tput setaf 7`"
+function fail {
+  echo -ne "`tput setaf 6`[`tput setaf 1` FAIL `tput setaf 6`]`tput setaf 7`"
 }
 
-died() 
-{
-       echo "`tput setaf 6`[`tput setaf 1` DIED `tput setaf 6`]`tput setaf 7`"
+function died {
+  echo -ne "`tput setaf 6`[`tput setaf 1` DIED `tput setaf 6`]`tput setaf 7`"
 }
 
-deltext() 
-{
-       echo -ne '\b\b\b\b\b\b\b\b'
+function deltext {
+  echo -ne '\b\b\b\b\b\b\b\b'
 }
 
 # A function to start a program.
@@ -113,7 +100,7 @@ killproc() {
                        # TERM first, then KILL if not dead
                        kill -TERM $pid &> $TMPFILE
                        usleep 100000
-                       dead=`ps aux | awk '{print $2}' | grep $pid`
+                       dead=`ps -o pid= $pid`
                        if [ "$dead" != "" ]; then
                                sleep 3
                                kill -KILL $pid &> $TMPFILE
@@ -160,17 +147,17 @@ pidofproc() {
        fi
 
        # Next try "pidof"
-       pid=`pidof $1`
+       #pid=`pidof $1`
        if [ "$pid" != "" ] ; then
                echo $pid
                return 0
        fi
 
        # Finally try to extract it from ps
-       ps auxw | awk 'BEGIN { prog=ARGV[1]; ARGC=1 } 
-                          { if ((prog == $11) || (("(" prog ")") == $11) ||
-                          ((prog ":") == $11)) { print $2 } }' $1
+       echo `ps -C $1 -o pid=`
+       return 0
 }
+
 status() {
        # Test syntax.
        if [ $# = 0 ] ; then
@@ -184,9 +171,9 @@ status() {
                echo "$1 (pid $pid) is running..."
                return 0
         else
-                pid=`ps auxww | grep $1 | egrep -v grep\|$0 | awk '{print $2}'`
+                pid=`echo \`ps -C $1 -o pid= \``
                 if [ "$pid" != "" ] ; then
-                        echo "$1 (pid $pid) is running..."
+                        echo  "$1 (pid $pid) is running..."
                         return 0
                 fi
        fi
index 7c541035a6e4f8d7be750348f14cfc4c38588b73..3bd8e94d85613ba4c817aa1907aeadcb8947830d 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 #!F:functions-ip6
 #
 #      tunnels-up-ip6, tunnels-down-ip6
 #
 #!C:Copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
+#!C:some code by Gregorz Stanislawski <stangrze@open.net.pl>
 #
-#!V:Version: 2.39 01.05.1998
+#!V:Version: 2.41a 10.11.1998
 #
-# Changes from:
-# 2.32: exchange 'exit' with 'return' (bad mistake...)
-# 2.33: new debug level (bit 2) 
-# 2.34: minor improvements 
-# 2.35: info  
-# 2.36: add IP6FORWARDING switch (to differ between a host and a router)
-# 2.37: add forwarding switch for kernel versions >= 2.1.90 (idea by Dan Anderson anderson@computer.org)
-# 2.38: make IP6FORWARDING independed from IP6GATEWAYCONFIG
-
+# Changes to:
+#  2.34: new debug level (bit 2) 
+#  2.35: minor improvements 
+#  2.36: info  
+#  2.37: add IP6FORWARDING switch (to differ between a host and a router)
+#  2.38: add forwarding switch for kernel versions >= 2.1.90
+#        (idea by Dan Anderson anderson@computer.org)
+#  2.39: make IP6FORWARDING independed from IP6GATEWAYCONFIG
+#  2.40: NBMA tunnel setup support, see 'network-ip6.conf v2.11+' for details
+#  2.41: Error sign to get a right exit value of each function (only 0 = ok)
+#  2.41a: 
+#    - Scripts now make use of iproute2 package by Alexey Kuznietsov.
+#    - Config file splited to 2 files: network-ip6.conf & tunnels-ip6.conf.
+#    - Changes to file layout. for better incorporation into PLD or Redhat systems. 
+#    - Removed support for radvd (Most of people use mrtd anyway)
+#    - Removed support fod nbma tunnel conf.
 IP6NETWORKFILE=/etc/sysconfig/network-ip6
 
 # debug level & 2 prevents from executing any network configuration
 # debug level & 4 shows messages in the test section
 
+# Return values
+#  0 = ok
+#  1 = error occurs
+#  2 = not enabled, i.e. no IPv6 kernel support or switched off by configuration
+
+# File as error sign
+EXITFAIL=/tmp/functions-ip6.error
+
 
 ##### Test for IPv6
 
 function test-ip6()
 {
+    # Remove error sign file
+    rm -f $EXITFAIL
+    
     if [ "$IP6DEBUG" = "" ] ; then IP6DEBUG=0; fi
 
     if ! [ $[ $IP6DEBUG & 4 ] = 0 ] ; then
@@ -45,12 +65,7 @@ function test-ip6()
     fi
 
     if ! [ -f /proc/net/if_inet6 ]; then
-        if ! [ $[ $IP6DEBUG & 4 ] = 0 ] ; then
-            echo -e "\a Not compiled for IPv6 - stop!"
-        else
-            echo -e "\a Kernel not compiled for IPv6 - stop!"
-        fi
-        return 1
+        return 2
     else
         if ! [ $[ $IP6DEBUG & 4 ] = 0 ] ; then
             echo " Ok!"
@@ -91,8 +106,10 @@ function test-ip6()
     if ! [ "$IP6NETWORKING" = "yes" ] ; then
         if ! [ $[ $IP6DEBUG & 4 ] = 0 ] ; then
            echo -e "\a No - stop!"
+       else
+           echo -e "\a IPv6 configuration isn't enabled - stop!"
        fi
-        return 3
+        return 2
     else
         if ! [ $[ $IP6DEBUG & 4 ] = 0 ] ; then
             echo " Yes!"
@@ -124,14 +141,25 @@ function return-ip6()
 function ifup-routes-ip6()
 {
     # Run IPv6 test
-    test-ip6 || return    
+    test-ip6 || return    
 
     # Allow forwarding option, host is a router?
     if [ "$IP6FORWARDING" = "yes" ]; then
         # Switch on IPv6 forwarding in the kernel if off
        
+       # Which mechanism? kernel >= 2.1.90 uses forwarding switch by device
+        if [ -f /proc/sys/net/ipv6/forwarding ]; then
+           # for kernel < 2.1.90
+            if ! [ "`cat /proc/sys/net/ipv6/forwarding`" = "1" ]; then
+                echo "  Switch on IPv6 forwarding in the kernel"
+                if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
+                   echo "1" > /proc/sys/net/ipv6/forwarding
+               fi
+            fi
+       fi
+       
        if [ -f /proc/sys/net/ipv6/conf/all/forwarding ]; then
-
+           # for kernel >= 2.1.90
            for i in /proc/sys/net/ipv6/conf/*/forwarding; do
                 if ! [ "`cat $i`" = "1" ]; then
                    device=`echo $i | cut -d / -f 7` 
@@ -155,6 +183,7 @@ function ifup-routes-ip6()
 
     # Device "lo" need no IPv6 configuration
     if [ "$1" = "lo" ]; then
+        echo "  Device lo needs no IPv6 routing configuration"
         return 1;
     fi
 
@@ -177,32 +206,41 @@ function ifup-routes-ip6()
 
     grep "^$1" $IP6ROUTEFILE | while read device key gateway route; do
        if [ "$key" = "route" ]; then
-            echo "  Add IPv6 route $route gw $gateway dev $device"
+            echo "  Add IPv6 route $route via $gateway dev $device"
             if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                 route -A inet6 add $route gw $gateway dev $device
+                route -A inet6 add $route gw $gateway metric 1 dev $device || touch $EXITFAIL
            fi
         fi
     done
 
     return-ip6
+    
+    if [ -f $EXITFAIL ]; then
+       return 1
+       rm -f $EXITFAIL
+    else
+       return 0
+    fi
 }
 
 
 function ifdown-routes-ip6()
 {
     # Run IPv6 test
-    test-ip6 || return 1    
+    test-ip6 || return
 
     if ! [ "$IP6GATEWAYCONFIG" = "yes" ]; then return 1; fi
 
     echo " Clear IPv6 routes"
 
     if [ "$1" = "" ]; then
+       echo -e "\a  Usage: $0 <net-device>"
        return 1
     fi
     
     # Device "lo" need no IPv6 configuration
     if [ "$1" = "lo" ]; then
+        echo "  Device lo needs no IPv6 routing configuration"
         return 1;
     fi
 
@@ -225,14 +263,21 @@ function ifdown-routes-ip6()
     
     grep "^$1" $IP6ROUTEFILE | while read device key gateway route; do
        if [ "$key" = "route" ]; then
-            echo "  Del IPv6 route $route gw $gateway dev $device"
+            echo "  Del IPv6 route $route via $gateway dev $device"
             if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                route -A inet6 del $route gw $gateway dev $device
+                route -A inet6 del $route gw $gateway dev $device || touch $EXITFAIL
            fi
         fi
     done
 
     return-ip6
+    
+    if [ -f $EXITFAIL ]; then
+       return 1
+       rm -f $EXITFAIL
+    else
+       return 0
+    fi
 }
 
 
@@ -241,8 +286,9 @@ function ifdown-routes-ip6()
 ## Configure tunnels up
 function tunnels-up-ip6()
 {
+echo "test"
     # Run IPv6 test
-    test-ip6 || return    
+    test-ip6 || return    
 
     if ! [ "$IP6TUNNELCONFIG" = "yes" ]; then return 1; fi
 
@@ -268,55 +314,53 @@ function tunnels-up-ip6()
         # get IPv6-over-IPv4 tunnels up (enables automatic to 0::0/96)
         echo "  Get IPv6-over-IPv4 tunnels up (enables automatic to 0::0/96)"
         if [ $[ $IP6DEBUG & 2 ] = 0 ] ; then
-            ifconfig sit0 up
+            ifconfig sit0 up || touch $EXITFAIL
         fi
 
         # Take configured tunnels from $IP6TUNNELFILE
-        TUNNELDEV=1
-
-       grep "^sit" $IP6TUNNELFILE | while read device key ip4gateway;  do  
-
-            if [ "$device" = "sit$TUNNELDEV" ]; then
 
+       grep -v "^#" $IP6TUNNELFILE | while read device key local remote ttl realdev;  do  
                if [ "$key" = "tunnel" ]; then
-                    echo "  Add tunnel sit$TUNNELDEV to $ip4gateway"
+                    echo "  Add tunnel $device to $remote"
            
                    # Set up a tunnel
-                    if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                       ifconfig sit0 tunnel ::$ip4gateway
-                    fi
+#                    if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
+#                      ifconfig sit0 tunnel ::$remote || touch $EXITFAIL
+#                    fi
             
                    # Start tunnel device sit?
                     if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                       ifconfig sit$TUNNELDEV up
+                       iptunnel add $device mode sit remote $remote local $local ttl $ttl dev $realdev
+echo "Tunnel $device added"
+                       ifconfig $device up arp multicast
+echo "Tunnel $device is configured and up"
+                       route -A inet6 add fe80::$remote dev $device
+echo "Routing to $remote via $device added"
                     fi
                 
-                    grep "^sit$TUNNELDEV" $IP6TUNNELFILE | while { read device key network; } do
+                    grep "^$device" $IP6TUNNELFILE | while { read device key network; } do
                     
                        if [ "$key" = "route" ]; then
-                            echo "   Add route to tunnel sit$TUNNELDEV for network $network"
+                            echo "   Add route to tunnel $device for network $network"
            
                            # Set route to tunnel
                             if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                               route -A inet6 add $network gw fe80::$ip4gateway dev sit$TUNNELDEV
+                            route -A inet6 add $network gw fe80::$remote dev $device || touch $EXITFAIL
                             fi
                        fi
                     done
 
-                    # Increment for next tunnel
-                    TUNNELDEV=$[ $TUNNELDEV + 1 ]
                 fi
-            fi 
        done 
-        
-
-#won't work, problem with local scope in while...
-#        if [ $[ $TUNNELDEV < 2 ] = 1 ]; then
-#           echo -e "\a  No tunnels configured!"
-#            echo "  $IP6TUNNELFILE: possible error in your tunnel setup!"
-#        fi
 
     return-ip6
+    
+    if [ -f $EXITFAIL ]; then
+       return 1
+       rm -f $EXITFAIL
+    else
+       return 0
+    fi
 }      
 
 
@@ -325,7 +369,7 @@ function tunnels-up-ip6()
 function tunnels-down-ip6()
 {
     # Run IPv6 test
-    test-ip6 || return 1    
+    test-ip6 || return
 
     if ! [ "$IP6TUNNELCONFIG" = "yes" ]; then return 1; fi
 
@@ -352,46 +396,47 @@ function tunnels-down-ip6()
 
         # Take configured tunnels from $IP6TUNNELFILE
 
-       grep "^sit" $IP6TUNNELFILE | while read device key ip4gateway; do
-
-            if [ "$device" = "sit$TUNNELDEV" ]; then
+       grep -v "^#" $IP6TUNNELFILE | while read device key local remote ttl realdev;  do  
 
                if [ "$key" = "tunnel" ]; then
-                
-                    grep "^sit$TUNNELDEV" $IP6TUNNELFILE | while read device key network; do
+                    grep "^$device" $IP6TUNNELFILE | while read device key host; do
                     
                        if [ "$key" = "route" ]; then
-                            echo "   Del route to tunnel sit$TUNNELDEV for network $network"
+                            echo "   Del route to tunnel $device for host $host"
            
                            # Set route to tunnel
                             if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                               route -A inet6 del $network gw fe80::$ip4gateway dev sit$TUNNELDEV
+                               route -A inet6 del $network gw fe80::$remote dev $device || touch $EXITFAIL
                             fi
                        fi
                     done
 
-                    echo "  Delete tunnel sit$TUNNELDEV"
+                    echo "  Delete tunnel $device"
            
                    # Stop tunnel device sit?
                     if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                       ifconfig sit$TUNNELDEV down
+                       ifconfig $device down  
+                       iptunnel del $device || touch $EXITFAIL
                     fi
 
-                    # Increment for next tunnel
-                    TUNNELDEV=$[ $TUNNELDEV + 1 ]
-                    
                 fi
-            fi
        done
 
         # Stop IPv6-over-IPv4 tunnels
         echo "  Stop IPv6-over-IPv4 tunnels"
         if [ $[ $IP6DEBUG & 2 ] = 0 ] ; then 
            echo "  Delete basic tunnel device sit0"
-            ifconfig sit0 down
+            ifconfig sit0 down || touch $EXITFAIL
         fi
 
     return-ip6
+    
+    if [ -f $EXITFAIL ]; then
+       return 1
+       rm -f $EXITFAIL
+    else
+       return 0
+    fi
 }
 
        
@@ -402,16 +447,18 @@ function tunnels-down-ip6()
 function ifup-ip6()
 {
     if [ "$1" = "" ]; then
+       echo -e "\a  Usage: $0 <net-device>"
        return 1
     fi
 
     # Device "lo" need no IPv6 configuration
     if [ "$1" = "lo" ]; then
+        echo "  Device lo needs no IPv6 configuration"
         return 1;
     fi
 
     # Run IPv6 test
-    test-ip6 || return    
+    test-ip6 || return    
 
     echo " Brings interface $1 up for IPv6"
 
@@ -424,17 +471,24 @@ function ifup-ip6()
        if [ "$key" = "iface" ]; then
             echo "  Add for dev $device IPv6 address $prefix:$suffix/$length"
             if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                ifconfig $device add $prefix:$suffix/$length
+                ifconfig $device add $prefix:$suffix/$length || touch $EXITFAIL
            fi
     
             echo "  Add IPv6 route $prefix::0/$length through dev $device"
             if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                route -A inet6 add $prefix::0/$length dev $device
+                route -A inet6 add $prefix::0/$length dev $device || touch $EXITFAIL
            fi
         fi
     done
 
     return-ip6
+
+    if [ -f $EXITFAIL ]; then
+       return 1
+       rm -f $EXITFAIL
+    else
+       return 0
+    fi
 }
 
 
@@ -443,6 +497,7 @@ function ifup-ip6()
 function ifdown-ip6()
 {
     if [ "$1" = "" ]; then
+       echo -e "\a  Usage: $0 <net-device>"
        return 1
     fi
 
@@ -450,7 +505,7 @@ function ifdown-ip6()
     if [ "$1" = "lo" ]; then return 0; fi
 
     # Run IPv6 test
-    test-ip6 || return    
+    test-ip6 || return    
 
     echo " Brings interface $1 down from IPv6"
 
@@ -463,15 +518,22 @@ function ifdown-ip6()
        if [ "$key" = "iface" ]; then
             echo "  Del IPv6 route $prefix::0/$length through dev $device"
             if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                route -A inet6 del $prefix::0/$length dev $device
+                route -A inet6 del $prefix::0/$length dev $device || touch $EXITFAIL
             fi
 
             echo "  Del for dev $device IPv6 address $prefix:$suffix/$length"
             if [ $[ $IP6DEBUG & 2 ] = 0 ]; then
-                ifconfig $device del $prefix:$suffix/$length
+                ifconfig $device del $prefix:$suffix/$length || touch $EXITFAIL
            fi
         fi
     done
 
     return-ip6
+    
+    if [ -f $EXITFAIL ]; then
+       return 1
+       rm -f $EXITFAIL
+    else
+       return 0
+    fi
 }
index 82625c693a54d2d53fe5367b98ade5b4b63243b1..0daec3d0d2a5c43f0dfcae0cfc28b431aa7647be 100644 (file)
@@ -1,58 +1,25 @@
-#!/bin/bash
+#!/bin/sh
 #
-# rc.halt       This file is executed by init when it goes into runlevel
-#               0 (halt) or runlevel 6 (reboot). It kills all processes,
-#               unmounts file systems and then either halts or reboots.
+# halt          Script for system halt.
 #
-# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
-#               Modified for RHS Linux by Damien Neil
+# chkconfig: 0 00 99
+# description: This file is executed by init when it goes into runlevel \
+#               runlevel 0 (halt). It calls common code for halt/reboot \
+#              from shutdwn which kills all processes, unmounts file  \
+#              systems and then either halts or reboots.
+#
+# Author:       Grzegorz Stanislawski <stangrze@open.net.pl>
 #
-
-# Set the path.
-PATH=/sbin:/bin:/usr/bin:/usr/sbin
 
 # See how we were called.
-case "$0" in
-  *halt)
-       message="The system is halted"
-       command="halt"
-       ;;
-  *reboot)
-       message="Please stand by while rebooting the system..."
-       command="reboot"
+case "$1" in
+  stop*)
+       exit 0
        ;;
-  *)
-       echo "$0: call me as \"rc.halt\" or \"rc.reboot\" please!"
-       exit 1
+  start*)
+       . /etc/rc.d/init.d/shutdwn
+        echo "The system is halted"
+       [ -f /fastboot ] && echo "On the next boot fsck will be skipped."
+       eval halt -d
        ;;
 esac
-
-# Kill all processes.
-[ "${BASH+bash}" = bash ] && enable kill
-
-echo "Sending all processes the TERM signal..."
-kill -15 -1
-sleep 5
-echo "Sending all processes the KILL signal.."
-kill -9 -1
-
-# Write to wtmp file before unmounting /var
-halt -w
-
-# Turn off swap, then unmount file systems.
-echo "Turning off swap"
-swapoff -a
-echo "Unmounting file systems"
-umount -a
-mount -n -o remount,ro /
-
-echo "Remounting remaining filesystems (if any) readonly"
-mount | awk '/ext2/ { print $3 }' | while read line; do
-    mount -n -o ro,remount $line
-done
-
-# Now halt or reboot.
-echo "$message"
-[ -f /fastboot ] && echo "On the next boot fsck will be skipped."
-eval $command -d
-
index 9d2441192e2eb1c747fb506c22a624e82eee8307..7529bf782166aaa085133cca32acc9215d4afd61 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # Bring down all unneeded services that are still running (there shouldn't 
 # be any, so this is just a sanity check)
index 42c0e70126fe1027a25dd83eecf7b7337030b877..03243282a13f02151d8f1605d01ee7ce8d23d1c3 100644 (file)
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 #
 # network       Bring up/down networking
 #
-# chkconfig: 345 10 97
+# chkconfig: 2345 10 90
 # description: Activates/Deactivates all network interfaces configured to \
 #              start at boot time.
 # probe: true
@@ -21,20 +21,20 @@ if [ -f /etc/sysconfig/pcmcia ]; then
 fi
 
 if [ -f /etc/sysconfig/network-ip6 ]; then
-       . /etc/sysconfig/network-ip6
+       . /etc/sysconfig/network-ip6
 fi
 
+
 # Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
+[ "${NETWORKING}" = "no" ] && exit 0
 
 [ -x /sbin/ifconfig ] || exit 0
 
 # Load IPv6 module
-
-if [ ${IP6NETWORKING} = "yes" ]; then
-       if [ -r /lib/modules/`uname -r`/ipv6/ipv6.o ]; then
-       /sbin/modprobe net-pf-10
-       fi
+if [ "${IP6NETWORKING}" = "yes" ]; then
+       if [ -r /lib/modules/`uname -r`/ipv6/ipv6.o ]; then
+       /sbin/modprobe net-pf-10
+       fi
 fi
 
 # Even if IPX is configured, without the utilities we can't do much
@@ -61,46 +61,85 @@ ipv4_forward_set ()
            else
                if [ "$FORWARD_IPV4" = "no" -o "$FORWARD_IPV4" = "false" ]; then
                    value=0
-                   message="Disabling IPv4 packet forwarding."
+                   message="Disabling IPv4 packet forwarding"
                else
                    value=1
-                   message="Enabling IPv4 packet forwarding."
+                   message="Enabling IPv4 packet forwarding :"
                fi
 
                if [ $value != `cat /proc/sys/net/ipv4/ip_forward` ]; then
                    show $message
                    busy
                    echo "$value" > /proc/sys/net/ipv4/ip_forward
-                   deltext
-                   ok
+                   deltext; ok
                fi
            fi
        fi
 }
 
-ipv4_spoof_protection ()
-{
-# This is the best method: turn on Source Address Verification and get
-# spoof protection on all current and future interfaces.
-if [ -e /proc/sys/net/ipv4/conf/all/rp_filter ]; then
-  show Setting up IP spoofing protection
-  busy
-  for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
-      echo 1 > $f
-  done
-  deltext
-  ok
-  else
-  deltext
-  fail
-  echo "PROBLEMS SETTING UP IP SPOOFING PROTECTION.  BE WORRIED!"
-fi
+ipv4_spoofing_protection ()
+ {
+        if [ -d /proc/sys/net/ipv4 ]; then
+            # people could have left this out of their kernel, which isn't
+            # exactly an error
+            if [ ! -f /proc/sys/net/ipv4/conf/all/rp_filter ] ; then
+                echo "/proc/sys/net/ipv4/conf/all/rp_filter is missing --" \
+                        "cannot control IP spoofing protection" >&2
+            else
+               if [ "$SPOOFING_IPV4" = "no" -o "$SPOOFING_IPV4" = "false" ]; then
+                    value=0
+                    message="Disabling IPv4 spoofing protection: "
+                else
+                    value=1
+                    message="Enabling IPv4 spoofing protection: "
+                fi
+
+                if [ $value != `cat /proc/sys/net/ipv4/conf/all/rp_filter` ]; then
+                    show $message
+                    busy
+                   for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
+                        echo $value > $f
+                   done
+                    deltext
+                    ok
+                fi
+            fi
+       fi
 }
 
+ipv4_icmp_echo_ignore_broadcasts ()
+{
+        if [ -d /proc/sys/net/ipv4 ]; then
+            # people could have left this out of their kernel, which isn't
+            # exactly an error
+            if [ ! -f /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts ] ; then
+                echo "/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts is missing --" \
+                        "cannot control IP ignoring icmp to broadcasts" >&2
+            else
+                if [ "$IGNORE_ICMP_BCAST_IPV4" = "no" -o "$IGNORE_ICMP_BCAST_IPV4" = "false" ]; then
+                    value=0
+                    message="Disabling IPv4 ign icmp_echo to our bcasts: "
+                else
+                    value=1
+                    message="Enabling IPv4 ign icmp_echo to our bcasts: "
+                fi
+
+                if [ $value != `cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts` ]; then
+                    show $message
+                    busy
+                    echo "$value" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
+                    deltext
+                    ok
+                fi
+            fi
+       fi
+ }
+
 # See how we were called.
 case "$1" in
   start)
        ipv4_forward_set
+       ipv4_icmp_echo_ignore_broadcasts
 
        ./ifup ifcfg-lo
 
@@ -116,11 +155,14 @@ case "$1" in
                ./ifup $i boot
        done
 
-       ipv4_spoof_protection
+       ipv4_spoofing_protection
 
         touch /var/lock/subsys/network
         ;;
   stop)
+       SPOOFING_IPV4=no
+       ipv4_spoofing_protection
+
        for i in $interfaces; do
                ./ifdown $i boot
        done
@@ -130,90 +172,29 @@ case "$1" in
            ;;
        esac
        ./ifdown ifcfg-lo
-       echo "Disabling IPv4 packet forwarding."
+       show "Disabling IPv4 packet forwarding: "
+       busy
        echo 0 > /proc/sys/net/ipv4/ip_forward
+       deltext; ok
+
+       IGNORE_ICMP_BCAST_IPV4=no
+       ipv4_icmp_echo_ignore_broadcasts
+
         rm -f /var/lock/subsys/network
         ;;
   status)
        echo "Configured devices:"
        echo lo $interfaces
 
-       if [ -x /bin/linuxconf ] ; then
-               eval `/bin/linuxconf --hint netdev`
-               echo "Devices that are down:"
-               echo $DEV_UP
-               echo "Devices with modified configuration:"
-               echo $DEV_RECONF
-       else
-               echo "Currently active devices:"
-               echo `/sbin/ifconfig | grep ^[a-z] | awk '{print $1}'`
-       fi
+       echo "Currently active devices:"
+       echo `/sbin/ifconfig | grep ^[a-z] | awk '{print $1}'`
        ;;
   restart)
        $0 stop
        $0 start
        ;;
-  reload)
-       if [ -x /bin/linuxconf ] ; then
-               eval `/bin/linuxconf --hint netdev`
-               if [ "$RECONF_IPV4ROUTING" = "yes" ] ; then
-                       ipv4_forward_set
-               fi
-               for device in $DEV_UP ; do
-                       ./ifup $device
-               done
-               for device in $DEV_DOWN ; do
-                       ./ifdown $device
-               done
-               for device in $DEV_RECONF ; do
-                       ./ifdown $device
-                       ./ifup $device
-               done
-               for device in $DEV_RECONF_ALIASES ; do
-                       /etc/sysconfig/network-scripts/ifup-aliases $device
-               done
-               for device in $DEV_RECONF_ROUTES ; do
-                       /etc/sysconfig/network-scripts/ifup-routes $device
-               done
-               case $IPX in yes|true)
-                 case $IPXINTERNALNET in
-                   reconf)
-                       /usr/bin/ipx_internal_net del
-                       /usr/bin/ipx_internal_net add $IPXINTERNALNETNUM \
-                                                     $IPXINTERNALNODENUM
-                       ;;
-                   add)
-                       /usr/bin/ipx_internal_net add $IPXINTERNALNETNUM \
-                                                     $IPXINTERNALNODENUM
-                       ;;
-                   del)
-                       /usr/bin/ipx_internal_net del
-                       ;;
-                 esac
-                 ;;
-               esac
-       else
-               $0 restart
-       fi
-       ;;
-  probe)
-       if [ -x /bin/linuxconf ] ; then
-               eval `/bin/linuxconf --hint netdev`
-               [ -n "$DEV_UP$DEV_DOWN$DEV_RECONF$DEV_RECONF_ALIASES" -o \
-                 -n "$DEV_RECONF_ROUTES$IPXINTERNALNET" -o \
-                 "$RECONF_IPV4ROUTING" = yes ] && \
-                       echo reload
-               exit 0
-       else
-               # if linuxconf isn't around to figure stuff out for us,
-               # we punt.  Probably better than completely reloading
-               # networking if user isn't sure which to do.  If user
-               # is sure, they would run restart or reload, not probe.
-               exit 0
-       fi
-       ;;
   *)
-        echo "Usage: network {start|stop|restart|reload|status|probe}"
+        echo "Usage: network {start|stop|restart|status}"
         exit 1
 esac
 
diff --git a/rc.d/init.d/network-ip6.init b/rc.d/init.d/network-ip6.init
new file mode 100755 (executable)
index 0000000..d07bf54
--- /dev/null
@@ -0,0 +1,137 @@
+#!/bin/sh
+#
+# /etc/rc.d/init.d/network-ip6.init
+#
+# based on 
+##     network       Bring up/down networking
+##
+##     Modified:       Ngo Than
+##     Date:           07.04.1998
+######################################################################
+##     Modified: Erik Heim <erik@seitz.de>
+##     Date    : 19.3.98
+##     Reason  : for startup
+#####################################################################
+
+# and based on my several add-on scripts for IPv6
+#
+# IPv6 network configuration
+#
+# Copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
+#
+# Version 2.01 23.07.1998
+#
+# Changes to
+#  2.00: Merging of single scripts into one
+#  2.01: Updates for dual usage (DLD 5.4 or another RedHat compatible system)
+
+subsys_parameter=$1
+LOCKDIR=/var/lock/subsys
+##################################################################
+start_and_stop() {
+       # Source function library.
+       [ ! -f /etc/rc.d/init.d/functions ] && exit 1
+       . /etc/rc.d/init.d/functions
+    # If some used functions were not defined until now...
+    # At the moment, only Delix DLD 5.4 supports them directly
+       
+       if ! print_message >/dev/null 2>&1; then
+           print_message () {
+               $0 ${subsys_parameter}_msg
+           }
+       fi
+       if ! check_lock >/dev/null 2>&1; then
+           check_lock() {
+               local LOCK_FAIL
+               if [ $# = 0 ]; then
+                   echo "check_lock Lockfile start|stop"
+                   return 2
+               fi
+               LOCK_FAIL=0
+               if [ -f "$1" -a "$2" = "stop" ]; then LOCK_FAIL=1 ; fi
+               if [ ! -f "$1" -a "$2" = "start" ]; then LOCK_FAIL=1 ; fi
+               echo
+               return $LOCK_FAIL
+           }
+       fi
+
+       if ! logexec >/dev/null 2>&1; then
+           logexec() {
+               $*
+           }
+       fi
+
+    ## End of defines
+       
+       [ ! -f /etc/sysconfig/network ] && exit 1
+       . /etc/sysconfig/network
+       # Source PCMCIA
+       if [ -f  /etc/sysconfig/pcmcia ]; then
+               . /etc/sysconfig/pcmcia
+       fi
+       # Check that networking is up.
+       [ "$NETWORKING" = "yes" ] || exit 2
+       [ -x /sbin/ifconfig ] || exit 1
+       [ ! -d /etc/sysconfig/network-scripts ] && exit 1
+       
+       print_message
+       
+       check_lock $LOCKDIR/network-ip6 "$subsys_parameter"
+       if [ "$?" = 0 ]; then exit 0 ; fi
+
+
+        [ ! -f /etc/rc.d/init.d/functions-ip6 ] && exit 1
+       . /etc/rc.d/init.d/functions-ip6
+
+       test-ip6 || exit 
+
+       cd /etc/sysconfig/network-scripts
+       interfaces=`/bin/ls ifcfg* | egrep -v '(ifcfg-lo|:)' | egrep 'ifcfg-[a-z0-9]+$'`
+}
+
+##################################################################
+# See how we were called.
+##################################################################
+case "$subsys_parameter" in
+  start_msg)
+       echo -n "Start IPv6-Networkinterface(s)-Configuration."
+        ;;
+  stop_msg)
+       echo -n "Stop IPv6-Networkinterface(s)-Configuration."
+        ;;
+  start)
+        start_and_stop
+       for i in $interfaces; do
+           REALDEVICE=`echo $i | sed 's/ifcfg-//g'`
+           logexec ifup-ip6 $REALDEVICE
+           logexec ifup-routes-ip6 $REALDEVICE
+       done
+       
+       logexec touch $LOCKDIR/network-ip6.init
+       
+        exit $FAIL
+        ;;
+  stop)
+        start_and_stop
+       for i in $interfaces; do
+           REALDEVICE=`echo $i | sed 's/ifcfg-//g'`
+           logexec ifdown-routes-ip6 $REALDEVICE
+           logexec ifdown-ip6 $REALDEVICE
+       done
+       
+        logexec rm -f $LOCKDIR/network-ip6.init
+        exit $FAIL
+        ;;
+  restart)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  *)
+       echo "Usage: network-ip6 {start|stop|restart|start_msg|stop_msg}"
+        exit 1
+        ;;
+esac
+
+exit 0
+
index 71c97d3bc430014ced2f8a676cb73d7617bd6309..b1a97531edc9cef5684f7760ac808e6006d6833c 100644 (file)
@@ -21,7 +21,7 @@ fi
 . /etc/sysconfig/network
 
 # Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
+[ "${NETWORKING}" = "no" ] && exit 0
 
 case `uname -r` in
 0.*|1.*|2.0.*)
index 52c058fa03455c55388a77b2ac669e8b2a8e07d4..53dfc814e2ee61353c483810540185fd4db29361 100644 (file)
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 #
 # random       Script to snapshot random state and reload it at boot time.
 #
 # Author:       Theodore Ts'o <tytso@mit.edu>
 #
-# chkconfig: 2345 20 80
+# chkconfig: 12345 20 80
 # description: Saves and restores system entropy pool for higher quality \
 #              random number generation.
 
diff --git a/rc.d/init.d/reboot b/rc.d/init.d/reboot
new file mode 100755 (executable)
index 0000000..6441a6e
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# reboot          Script for system halt/reboot.
+#
+# chkconfig: 6 00 00
+# description: This file is executed by init when it goes into runlevel \
+#               runlevel 6 (reboot). It calls common code for halt/reboot \
+#              from shutdwn which kills all processes, unmounts file  \
+#              systems and then either halts or reboots.
+#
+# Author:       Grzegorz Stanislawski <stangrze@open.net.pl>
+#
+
+# See how we were called.
+case "$1" in
+  stop*)
+       exit 0
+       ;;
+  start*)
+       . /etc/rc.d/init.d/shutdwn
+       echo "Please stand by while rebooting the system..."
+       [ -f /fastboot ] && echo "On the next boot fsck will be skipped."
+       eval reboot -d
+       ;;
+esac
diff --git a/rc.d/init.d/shutdwn b/rc.d/init.d/shutdwn
new file mode 100755 (executable)
index 0000000..aa961db
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# shutdwn       Common script for system halt/reboot.
+#
+# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
+#               Modified for PLD Linux by Grzegorz Stanislawski
+#
+
+# Set the path.
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+
+# Kill all processes.
+[ "${BASH+bash}" = bash ] && enable kill
+
+echo "Sending all processes the TERM signal..."
+kill -15 -1
+sleep 5
+echo "Sending all processes the KILL signal.."
+kill -9 -1
+
+# Write to wtmp file before unmounting /var
+halt -w
+
+# Turn off swap, then unmount file systems.
+echo "Turning off swap and accounting"
+swapoff -a
+[ -x /sbin/accton ] && /sbin/accton
+echo "Unmounting file systems"
+umount -a
+mount -n -o remount,ro /
+
+# turn off raid
+if [ -x /sbin/raidstop -a -f /etc/raidtab ]; then
+    /sbin/raidstop -a
+fi
+
+echo "Remounting remaining filesystems (if any) readonly"
+mount | awk '/ext2/ { print $3 }' | while read line; do
+    mount -n -o ro,remount $line
+done
index 222e4b8879bf35c839e97d303bb92290ee5397a9..f31b06c1d3c493a4d571d6d2dceb00449a68aad1 100644 (file)
@@ -1,32 +1,44 @@
-#!/bin/bash
+#!/bin/sh
 #
+# single        Script for sedding up administrative/rescue shell.
 #
-# rc.single     This file is executed by init when it goes into runlevel
-#               1, which is the administrative state. It kills all
-#               deamons and then puts the system into single user mode.
-#               Note that the file systems are kept mounted.
+# chkconfig: 1 00 00
+# description: This file is executed by init when it goes into runlevel \
+#               1, which is the administrative state. It kills all \
+#               deamons and then puts the system into single user mode. \
+#               Note that the file systems are kept mounted. \
 #
 # Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
-#               Modified for RHS Linux by Damien Neil
+#               Modified for PLD Linux by Grzegorz Stanislawski
 #
 
 # Set the path.
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
+case "$1" in
+   stop*)
+       exit 0
+       ;;
+   start*)
 # Kill all processes.
-[ "${BASH+bash}" = bash ] && enable kill
+       [ "${BASH+bash}" = bash ] && enable kill
 
-echo "Sending all processes the TERM signal..."
-kill -15 -1
-sleep 5
-echo "Sending all processes the KILL signal.."
-kill -9 -1
+       echo "Sending all processes the TERM signal..."
+       kill -15 -1
+       sleep 5
+       echo "Sending all processes the KILL signal.."
+       kill -9 -1
 
-rm -f /var/lock/subsys/*
+       rm -f /var/lock/subsys/*
 
-# this looks nices
-[ -x /usr/bin/clear ] && /usr/bin/clear
+       # this looks nices
+       [ -x /usr/bin/clear ] && /usr/bin/clear
 
-# Now go to the single user level.
-echo "Telling INIT to go to single user mode."
-exec init -t1 S
+       ## we just killed kerneld :-(
+       #/etc/rc.d/init.d/kerneld start
+
+       # Now go to the single user level.
+       echo "Telling INIT to go to single user mode."
+       exec init -t1 S
+       ;;
+esac
diff --git a/rc.d/init.d/tunnels-ip6.init b/rc.d/init.d/tunnels-ip6.init
new file mode 100755 (executable)
index 0000000..712c877
--- /dev/null
@@ -0,0 +1,131 @@
+#!/bin/sh
+#
+# /etc/rc.d/init.d/tunnels-ip6.init
+#
+# based on 
+##     network       Bring up/down networking
+##
+##     Modified:       Ngo Than
+##     Date:           07.04.1998
+######################################################################
+##     Modified: Erik Heim <erik@seitz.de>
+##     Date    : 19.3.98
+##     Reason  : for startup
+#####################################################################
+
+# and based on my
+#      /etc/rc.d/init.d/tunnels-ip6.init
+#      Version 1.03
+#
+# Starts and stops the IPv6 over IPv4 tunnels
+#
+# Copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
+#
+# Version 1.12 07.08.1998
+#
+# Changes to
+#  1.10: Merge into DLD 5.4
+#  1.11: Updates for dual usage (DLD 5.4 or another RedHat compatible system)
+#  1.12: Bugfix, don't used the switch from network-ip6
+
+subsys_parameter=$1
+LOCKDIR=/var/lock/subsys
+##################################################################
+start_and_stop() {
+       # Source function library.
+       [ ! -f /etc/rc.d/init.d/functions ] && exit 1
+       . /etc/rc.d/init.d/functions
+       
+    # If some used functions were not defined until now...
+    # At the moment, only Delix DLD 5.4 supports them directly
+       
+       if ! print_message >/dev/null 2>&1; then
+           print_message () {
+               $0 ${subsys_parameter}_msg
+           }
+       fi
+
+       if ! check_lock >/dev/null 2>&1; then
+           check_lock() {
+               local LOCK_FAIL
+               if [ $# = 0 ]; then
+                   echo "check_lock Lockfile start|stop"
+                   return 2
+               fi
+               LOCK_FAIL=0
+               if [ -f "$1" -a "$2" = "stop" ]; then LOCK_FAIL=1 ; fi
+               if [ ! -f "$1" -a "$2" = "start" ]; then LOCK_FAIL=1 ; fi
+               echo
+               return $LOCK_FAIL
+           }
+       fi
+
+       if ! logexec >/dev/null 2>&1; then
+           logexec() {
+               $*
+           }
+       fi
+
+    # End of defines
+       
+       [ ! -f /etc/sysconfig/network ] && exit 1
+       . /etc/sysconfig/network
+       # Check that networking is up.
+       [ "$NETWORKING" = "yes" ] || exit 2
+       
+       [ -x /sbin/ifconfig ] || exit 1
+       print_message
+       
+    check_lock $LOCKDIR/tunnels-ip6.init "$subsys_parameter"
+       if [ "$?" = 0 ]; then exit 0 ; fi
+
+
+        [ ! -f /etc/rc.d/init.d/functions-ip6 ] && exit 1
+       . /etc/rc.d/init.d/functions-ip6
+       
+       test-ip6 || exit 
+       
+       [ "$IP6TUNNELCONFIG" = "yes" ] || exit 2
+}
+
+##################################################################
+# See how we were called.
+##################################################################
+case "$subsys_parameter" in
+  start_msg)
+       echo -n "Start IPv6-over-IPv4-Tunnel(s)."
+        ;;
+  stop_msg)
+       echo -n "Stop IPv6-over-IPv4-Tunnel(s)."
+       ;;
+  start)
+        start_and_stop
+       
+       logexec tunnels-up-ip6
+       
+        logexec touch $LOCKDIR/tunnels-ip6.init
+       
+        exit $FAIL
+        ;;
+  stop)
+        start_and_stop
+       
+       logexec tunnels-down-ip6
+       
+        logexec rm -f $LOCKDIR/tunnels-ip6.init
+       
+        exit $FAIL
+        ;;
+  restart)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  *)
+       echo "Usage: tunnels-ip6.init {start|stop|restart|start_msg|stop_msg}"
+       exit 1
+        ;;
+esac
+
+exit 0
+
diff --git a/rc.d/rc b/rc.d/rc
index 4b3dd644f314e386c50b93bd5f4894977297c207..a1194c37e5268c9a10c8350b509d53850af2a0a2 100755 (executable)
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # rc            This file is responsible for starting/stopping
 #               services when the runlevel changes. It is also
@@ -32,6 +32,10 @@ if [ -d /etc/rc.d/rc$runlevel.d ]; then
                # Check if the script is there.
                [ ! -f $i ] && continue
 
+               # Don't run [KS]??foo.{rpmsave,rpmorig} scripts
+               [ "${1%.rpmsave}" != "${1}" ] && continue
+               [ "${1%.rpmorig}" != "${1}" ] && continue
+
                # Check if the subsystem is already up.
                subsys=${i#/etc/rc.d/rc$runlevel.d/K??}
                [ ! -f /var/lock/subsys/$subsys ] && \
@@ -46,6 +50,10 @@ if [ -d /etc/rc.d/rc$runlevel.d ]; then
                # Check if the script is there.
                [ ! -f $i ] && continue
 
+               # Don't run [KS]??foo.{rpmsave,rpmorig} scripts
+               [ "${1%.rpmsave}" != "${1}" ] && continue
+               [ "${1%.rpmorig}" != "${1}" ] && continue
+
                # Check if the subsystem is already up.
                subsys=${i#/etc/rc.d/rc$runlevel.d/S??}
                [ -f /var/lock/subsys/$subsys ] || \
index 73f8381ed1c5a085a951a955acdb14086b6230a5..fdf5c9cc8a6f657860415258167d09fe8832a797 100755 (executable)
@@ -4,10 +4,3 @@
 # You can put your own initialization stuff in here if you don't
 # want to do the full Sys V style init stuff.
 
-arch=$(uname -m)
-a="a"
-case "_$arch" in
-        _a*) a="an";;
-        _i*) a="an";;
-esac
-
index 3d4a84ee78bbce5f5d0370981b3b27586df790e0..5176cbaab7e767c01fc16602ee64e4f16d06934d 100755 (executable)
@@ -1,7 +1,8 @@
+#!/bin/sh
 #
 # Setting serial ports. This will work only if you have setserial package installed.
 #
-# Format of /etc/serial.conf:
+# Format of /etc/sysconfig/serial:
 #/dev/ttyS0 uart 16450 port 0x3F8 irq 4
 #/dev/ttyS1 uart 16450 port 0x2F8 irq 3
 #/dev/ttyS2 uart 16450 port 0x3E8 irq 4
@@ -12,14 +13,11 @@ SETSERIAL=/bin/setserial
 [ -f $SETSERIAL ] || exit 0
 
 
-ALLDEVS="/dev/ttyS?"
-if /bin/ls /dev/ttyS?? >& /dev/null ; then
-       ALLDEVS="$ALLDEVS /dev/ttyS??"
-fi
+ALLDEVS="/dev/ttyS*"
 
 echo "Setting serial ports:"
-if test -f /etc/serial.conf ; then
-       grep -v ^# < /etc/serial.conf | grep "/dev/" | while read device args
+if test -f /etc/sysconfig/serial ; then
+       grep -v ^# < /etc/sysconfig/serial | grep "/dev/" | while read device args
        do
            ${SETSERIAL} -z $device $args
        done 
index 1ce0c75a977e5e467bcfec7b624d3feca74fdfa1..78bcb994cb899fba5326356689f71d0a9eb64b6e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # /etc/rc.d/rc.sysinit - run once at boot time
 #
@@ -52,7 +52,7 @@ if [ ! -f /fastboot ]; then
                echo "*** Dropping you to a shell; the system will reboot"
                echo "*** when you leave the shell."
 
-               PS1="(Repair filesystem) #"; export PS1
+               PS1="(Repair filesystem) \#"; export PS1
                sulogin
 
                echo "Unmounting file systems"
@@ -94,10 +94,6 @@ fi
 echo "Remounting root filesystem in read-write mode."
 mount -n -o remount,rw /
 
-if [ ! -f /etc/HOSTNAME ]; then
-    echo ${HOSTNAME} > /etc/HOSTNAME
-fi
-
 # Clear mtab
 >/etc/mtab
 
@@ -111,26 +107,17 @@ else
     USEMODULES=
 fi
 
-# Get the modules ready to go -- we use awk here as cut is in /usr/bin
+# Set up kernel version-dependent symlinks.
 rm -f /lib/modules/preferred
-if [ -n $USEMODULES ]; then
-    set `cat /proc/cmdline`
-    while [ $# -gt 0 ]; do
-       if echo $1 | grep '^BOOT_IMAGE=' > /dev/null ; then
-           image=`echo $1 | awk -F= '{ print $2 }'`
-           kernelfile=`/sbin/lilo -I $image`
-           if [ -n "$kernelfile" ]; then
-               kernelname=`echo $kernelfile | awk -F- '{ print $1 }'`
-               versioninfo=`echo $kernelfile | sed "s|${kernelname}-||"`
-               if [ "$kernelname" = "/boot/vmlinuz" -a \
-                    -d /lib/modules/$versioninfo -a \
-                    $versioninfo != `uname -r` ]; then
-                    ln -sf $versioninfo /lib/modules/preferred
-               fi
-           fi
-       fi
-       shift
-    done
+if [ -n "$USEMODULES" ]; then
+    ktag="`cat /proc/version`"
+    mtag=`grep -l "$ktag" /lib/modules/*/.rhkmvtag` 2> /dev/null
+    if [ -n "$mtag" ]; then
+       mver=`echo $mtag | sed -e 's,/lib/modules/,,' -e 's,/.rhkmvtag,,' -e 's,[       ].*$,,'`
+       ln -sf /lib/modules/$mver /lib/modules/preferred
+       ln -sf /boot/System.map-$mver /boot/System.map
+       ln -sf /boot/module-info-$mver /boot/module-info
+    fi
 fi
 
 if [ -x /sbin/depmod -a -n "$USEMODULES" ]; then
@@ -156,14 +143,40 @@ if ! grep -i nomodules /proc/cmdline >/dev/null ; then
     fi
 fi
 
-if [ -x /sbin/kerneld -a -n "$USEMODULES" ]; then
-    if [ -f /proc/sys/kernel/modprobe ]; then
+if [ -f /proc/sys/kernel/modprobe ]; then
        # /proc/sys/kernel/modprobe indicates built-in kmod instead
        echo "/sbin/modprobe" > /proc/sys/kernel/modprobe
-    else
-       /sbin/kerneld
-       KERNELD=yes
-    fi
+fi
+
+# Add raid devices
+if [ -f /proc/mdstat -a -f /etc/raidtab -a -x /sbin/raidadd ]; then
+       echo "Starting up RAID devices."
+       raidadd -a
+
+       rc=$?
+
+       if [ $rc = 0 ]; then
+               raidrun -a
+               rc=$?
+       fi
+
+       # A non-zero return means there were problems.
+       if [ $rc -gt 0 ]; then
+               echo
+               echo
+               echo "*** An error occurred during the RAID startup"
+               echo "*** Dropping you to a shell; the system will reboot"
+               echo "*** when you leave the shell."
+
+               PS1="(RAID Repair) \#"; export PS1
+               sulogin
+
+               echo "Unmounting file systems"
+               umount -a
+               mount -n -o remount,ro /
+               echo "Automatic reboot in progress."
+               reboot
+       fi
 fi
 
 # Check filesystems
@@ -171,15 +184,17 @@ if [ ! -f /fastboot ]; then
        echo "Checking filesystems."
        fsck -R -A -V -a $fsckoptions
 
+       rc=$?
+
        # A return of 2 or higher means there were serious problems.
-       if [ $? -gt 1 ]; then
+       if [ $rc -gt 1 ]; then
                echo
                echo
                echo "*** An error occurred during the file system check."
                echo "*** Dropping you to a shell; the system will reboot"
                echo "*** when you leave the shell."
 
-               PS1="(Repair filesystem) #"; export PS1
+               PS1="(Repair filesystem) \#"; export PS1
                sulogin
 
                echo "Unmounting file systems"
@@ -219,10 +234,6 @@ rm -f /var/lock/LCK*
 # Delete stale subsystem files.
 rm -f /var/lock/subsys/*
 
-if [ -n "$KERNELD" ]; then
-    touch /var/lock/subsys/kerneld
-fi
-
 # Delete stale pid files
 rm -f /var/run/*.pid
 rm -f /var/spool/postoffice/.pid.*
@@ -230,6 +241,9 @@ rm -f /var/spool/postoffice/.pid.*
 # Delete X locks
 rm -f /tmp/.X*-lock
 
+# Delete Postgres sockets
+rm -f /tmp/.s.PGSQL.*
+
 # Set the system clock.
 echo -n "Setting clock"
 
@@ -254,14 +268,20 @@ else
     CLOCK=/sbin/clock
 fi
 
-if [ $UTC = "true" ]; then
+case "$UTC" in
+  yes|true)
     CLOCKFLAGS="$CLOCKFLAGS -u";
     echo -n " (utc)"
-fi
-if [ $ARC = "true" ]; then
+  ;;
+esac
+
+case "$ARC" in
+  yes|true)
     CLOCKFLAGS="$CLOCKFLAGS -A";
     echo -n " (arc)"
-fi
+  ;;
+esac
+
 echo -n ": "
 $CLOCK $CLOCKFLAGS
 
@@ -295,6 +315,7 @@ fi
 # Now that we have all of our basic modules loaded and the kernel going,
 # let's dump the syslog ring somewhere so we can find it later
 dmesg > /var/log/dmesg
+chmod 640 /var/log/dmesg
 
 # Feed entropy into the entropy pool
 /etc/rc.d/init.d/random start
index 0afb4284f7aad441bb820d18f0f98b9649d7d13b..c0e3f57356a0b3e2682fb3233054f5dcab19bdcd 100644 (file)
@@ -8,23 +8,23 @@ clean:
        rm -f $(PROGS)
 
 install:
-       install -d $(ROOT)/bin $(ROOT)/usr/sbin $(ROOT)/usr/man/man1
-       install -s doexec $(ROOT)/bin/doexec
-       install -s usleep $(ROOT)/bin/usleep
-       install -s usernetctl $(ROOT)/usr/sbin/usernetctl
-       install -s netreport $(ROOT)/sbin/netreport
-       install -s ipcalc $(ROOT)/bin/ipcalc
-       install doexec.1 $(ROOT)/usr/man/man1
-       install netreport.1 $(ROOT)/usr/man/man1
-       install usleep.1 $(ROOT)/usr/man/man1
-       install usernetctl.1 $(ROOT)/usr/man/man1
-       install ipcalc.1 $(ROOT)/usr/man/man1
+       mkdir -p $(ROOT)/bin $(ROOT)/usr/sbin $(ROOT)/usr/man/man1
+       install -o 0 -g 0 -s -m 755 doexec $(ROOT)/bin/doexec
+       install -o 0 -g 0 -s -m 755 usleep $(ROOT)/bin/usleep
+       install -o 0 -g 0 -s -m 4755 usernetctl $(ROOT)/usr/sbin/usernetctl
+       install -o 0 -g 0 -s -m 2755 netreport $(ROOT)/sbin/netreport
+       install -o 0 -g 0 -s -m 755 ipcalc $(ROOT)/bin/ipcalc
+       install -m 644 doexec.1 $(ROOT)/usr/man/man1
+       install -m 644 netreport.1 $(ROOT)/usr/man/man1
+       install -m 644 usleep.1 $(ROOT)/usr/man/man1
+       install -m 644 usernetctl.1 $(ROOT)/usr/man/man1
+       install -m 644 ipcalc.1 $(ROOT)/usr/man/man1
 
 # this daemon and initscript are useful for testing the up/down/status stuff
 # not installed by default, only comes from sources.
 install-test:
-       install -s testd $(ROOT)/usr/sbin/testd
-       install testdinit $(ROOT)/etc/rc.d/init.d/testd
+       install -o 0 -g 0 -s -m 755 testd $(ROOT)/usr/sbin/testd
+       install -o 0 -g 0 -m 755 testdinit $(ROOT)/etc/rc.d/init.d/testd
 
 ipcalc: ipcalc.o
        $(CC) $(LDFLAGS) -o $@ $< -lpopt
index bad10c9638d05bc5a23bc0c91750bcea32026249..5a228bdc9dbd985dbfe021bccaa2a698770215e2 100644 (file)
@@ -87,12 +87,21 @@ int userCtl(char * file) {
        chptr = contents;
        while (*chptr != '\n') chptr++;
        end = chptr + 1;
-       while (chptr > contents && isspace(*chptr)) chptr--;
+       while (chptr >= contents && isspace(*chptr)) chptr--;
        *(++chptr) = '\0';
 
        if (!strncmp(contents, "USERCTL=", 8)) {
-           if (!strcmp(contents+8, "yes")) return FOUND_TRUE;
-           else return FOUND_FALSE;
+           contents += 8;
+           if (contents[0] == '"' &&
+               contents[strlen(contents) - 1] == '"') {
+               contents++;
+               contents[strlen(contents) - 1] = '\0';
+           }
+
+           if (!strcmp(contents, "yes") || !strcmp(contents, "true")) 
+               return FOUND_TRUE;
+           else 
+               return FOUND_FALSE;
        }
 
        contents = end;
index 2cf34705da4232f571bb5051f66f68065722e1be..3c9aabba51d1730ae1d78025acec1795184f020d 100644 (file)
@@ -45,6 +45,11 @@ Files in /etc/sysconfig
     FORWARD_IPV4 is not set at all, forwarding is *enabled*
     for compatibility with the configuration files used on
     Red Hat Linux versions 4.2 and earlier.)
+  IGNORE_ICMP_BCAST_IPV4=yes|no (Please note that if you accept ICMP echo
+    requests with a broadcast/multicast destination address your network
+    may be used as an exploder for denial of service packet flooding attacks
+   to other hosts.
+  SPOOFING_IPV4=yes|no (anti spoofing protection)
   GATEWAY=<gateway IP>
   GATEWAYDEV=<gateway device> (e.g. eth0)
   NISDOMAIN=<nis domain name>
@@ -136,6 +141,13 @@ Files in /etc/sysconfig
   BACKUPTAB=/etc/backuptab
     The file in which we keep our list of backup(s) we want to make.
 
+/etc/sysconfig/sendmail:
+  DAEMON=yes|no
+    yes implies -bd
+  QUEUE=1h
+    given to sendmail as -q$QUEUE
+    -q option is not given to sendmail if /etc/sysconfig/sendmail
+    exists and QUEUE is empty or undefined.
 
 
 Files in /etc/sysconfig/network-scripts/
@@ -243,6 +255,19 @@ Files in /etc/sysconfig/network-scripts/
     RETRYTIMEOUT=<number of seconds, default currently 60>
       (time to wait before re-attempting to establish a connection
       after a previous attempt fails.)
+    INITSCRIPT=<modem command>
+      string which initialises your modem. Usualy something like 
+      AT&F0&C1&D2
+      (PLD rc-scripts specific option)
+    DATAFORCHAT=<list of variables>
+      List of variables which should be exported to chat script.
+      Used mostly for passing USERNAME and PASSWORD into it. (see below)
+      (PLD rc-scripts specific option)
+    <anything>=<anything>
+      Variable name and it's value for use by chat script.
+      Note: You don't have to define variables here, if they are defined 
+      in parent process enviroment they will be used.
+      in.ex. USERNAME usualy is. 
 
 /etc/sysconfig/network-scripts/chat-<interface-name>:
 
@@ -250,7 +275,18 @@ Files in /etc/sysconfig/network-scripts/
   the connection.  For SLIP devices, a DIP script is written
   from the chat script; for PPP devices, the chat script is used
   directly.
-
+  In PLD version of rc-scripts, this file is parsed by shell
+  (actually by grep in firstplace to get rid of comments) before it
+  is passed to chat.
+  This allows you to substitute shell variables with their values 
+  defined in ifcfg-<interface name> or more generally in current env.
+  If You wonder about purbose, imagine one chat-script for all links 
+  at ISP's border router or computer in home where all users have own IPS's
+  accounts and want to pay only for themselfes.
+  Unfortunetly this parsing have impact on chat script syntax.
+  All characters that have special meaning for shell have to be escaped.
+  
+  
 /etc/sysconfig/network-scripts/dip-<interface-name>
 
   A write-only script created from the chat script by netcfg.
@@ -289,34 +325,21 @@ Files in /etc/sysconfig/network-scripts/
 /etc/sysconfig/i18n
 
   LANG= can be any two letter ISO language code
+  LC_ALL= is the setting of the localedata configuration (eg fr_CA)
   LINGUAS= can be a : separated list of language codes
   SYSTERM= use to set default TERM environment variable
 
   The above three variables are used in rc.sysinit.
 
-  SYSFONT= any font with is legal input to the 'setfont' command (see
-    kbd package)
+  SYSFONT= any font that is legal when used as
+       /usr/sbin/setfont $SYSFONT ...
+    (See kbd package for sysfont command)
+
+  UNIMAP= any unicode font that is legal fodder for
+       /usr/sbin/setfont $SYSFONT-u $UNIMAP
 
   The above is used by the /sbin/setsysfont command (which is run
   by rc.sysinit at boot time).
 
 
-##### ONLY IN POLISH (someone wants translate it to english ?) ###########
-
-/etc/sysconfig/bridge (musisz zainstalowaæ pakiet bridgex)
-
-   INTERFACES= lista interfejsów dla których w³±czamy bridging np.
-               INTERFACES="eth0 eth1"
-
-   bridgingon() {
-               tu umie¶æ komendy startuj±ce bridging dla odpowiednich
-               protoko³ów itd.
-               }
-
-/etc/sysconfig/console
-
-   CONSOLEFONT= font który za³adowaæ
-   CONSOLEMAP= Application-charset map (u¿ywana w trybie != Unicode)
-   KEYTABLE= tablica klawiatury
-
 
index 945f6f5effe79a4ba015dbf565424342d7f4807d..32aa6a891673ed36d546459a4a53cb6125f9150e 100644 (file)
@@ -5,21 +5,21 @@
 #!D:IPv6 network configuration file
 #
 #!C:Copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
+#!C:changes (versions X.XXa) by Grzegorz Stanislawski <stangrze@open.net.pl>
 #
-#!V:Version 1.11 05.03.1998
-
-# Changes from:
-# 1.00: nothing important
-# 1.10: add IP6FORWARDING switch (to differ between a host and a router)
+#!V:Version 1.11a 10.11.1998
 
+# Changes to:
+#  1.11: add IP6FORWARDING switch (to differ between a host and a router)
+#  1.11a: removed support for radvd
 
 ## IPv6 configuration debugging
 # Bit0: show all commands, bit1:don't execute anything
 IP6DEBUG=0
 
 ## IPv6 network configuration? {yes|no}
-#IP6NETWORKING=yes
-IP6NETWORKING=no
+IP6NETWORKING=yes
+#IP6NETWORKING=no
 
 # Take information from the file
 IP6INTERFACEFILE=/etc/sysconfig/network-ip6.conf
@@ -30,15 +30,15 @@ IP6INTERFACEFILE=/etc/sysconfig/network-ip6.conf
 # similar to the default gateway in IPv4)
 
 # Allow gateway configurations {yes|no}
-#IP6GATEWAYCONFIG=yes
-IP6GATEWAYCONFIG=no
+IP6GATEWAYCONFIG=yes
+#IP6GATEWAYCONFIG=no
 
 # Take information from the file 
 IP6ROUTEFILE=/etc/sysconfig/network-ip6.conf
 
 # Allow forwarding option, host is a router {yes|no}
-#IP6FORWARDING=yes
-IP6FORWARDING=no
+IP6FORWARDING=yes
+#IP6FORWARDING=no
 
 
 ## IPv6 tunnels
@@ -47,21 +47,8 @@ IP6FORWARDING=no
 # tunnel to you
 
 # Allow IPv6 tunnel interface configuration {yes|no}
-#IP6TUNNELCONFIG=yes
-IP6TUNNELCONFIG=no
+IP6TUNNELCONFIG=yes
+#IP6TUNNELCONFIG=no
  
 # Take information from the file
-IP6TUNNELFILE=/etc/sysconfig/network-ip6.conf
-
-
-
-## Router Advertisement Daemon
-# Start Daemon {yes|no}
-#IP6RADVD=yes
-IP6RADVD=no
-
-# Sepcify configuration file
-IP6RADVDFILE="/etc/sysconfig/radvd.conf"
-
-# Specify options
-#IP6RADVDOPTIONS="-d 9"
+IP6TUNNELFILE=/etc/sysconfig/tunnels-ip6.conf
index 705b26fe6f23a5438eeb655e7e8248a1ab6b9c57..fe92dfe03d5adf741e4f39382fcb51f77f2492a9 100644 (file)
@@ -2,14 +2,23 @@
 #
 #!P:/etc/sysconfig
 #
+#!S:root:root 440
+#
 #!D:IPv6 configuration file
 #
 #!C:Copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
+#!C:changes (versions X.XXa) by Grzegorz Stanislawski <stangrze@open.net.pl>
 #
-#!V:Version 2.11 05.01.1998
-
-# Changes from 2.10: nothing important
+#!V:Version 2.12a 10.11.1998
 
+# Changes to 
+#  2.11: nothing important
+#  2.12: NBMA tunnel configuration ready
+#  2.12a: 
+#    - tunnel section moved out to tunnels-ip6.conf
+#    - Use of iproute2 program in functions-ip6 script allows "verbose"
+#      interface names in kernel iface table and this file
+#    - 
 
 # This file is needed by 'functions-ip6' version 2.xx
 
 ### necessary. The important values are 'device' and 'key'!
 
 
-################# Tunnel section 
-
-## Here you can configure tunnel endpoints. Be sure, that you set the device
-## entry in a right way like 'sit1', 'sit2' and so on, otherwise you will get
-## an error information from 'functions-ip6'
-
-#Device        Key                             IPv4 gateway address
-sit1   tunnel                          137.193.227.41
-
-
-# Tunnel route section 
-# Here you can specify several routes to your configured tunnels.
-# More than one are possible!
-
-#Device        Key                             Network
-sit1   route                           3ffe::/16
-
-
 ################# Interface section 
 
 ## Here you can specify several addresses for your interfaces.
 ## More than one are possible!
 
 #Device        Key     prefix                          suffix          length
-eth0   iface   fec0:0:0:1                      0:0:0:1         64      
-eth0   iface   3ffe:0400:0100:f101             0:0:0:1         64              
-    
+#eth0  iface   fec0:0:0:1                      0:0:0:1         64      
+eth0   iface   3ffe:902:10                     0:0:0:0:3       112             
 
 ################# Gateway section
  
@@ -51,7 +41,7 @@ eth0  iface   3ffe:0400:0100:f101             0:0:0:1         64
 ## More than one are possible!
 
 #Device        Key     Gateway address                         Network
-eth0   route   fec0:0:0:1:0:0:0:20                     fec0:0:0:2::/64 
-eth0   route   3ffe:0400:0100:f101:0:0:0:20            3ffe:0400:0100:f102::/64
+#eth0  route   fec0:0:0:1:0:0:0:20                     fec0:0:0:2::/64 
+#eth0  route   3ffe:0400:0100:f101:0:0:0:20            3ffe:0400:0100:f102::/64
 
     
diff --git a/sysconfig/network-scripts/chat-ppp0.callback b/sysconfig/network-scripts/chat-ppp0.callback
new file mode 100644 (file)
index 0000000..27daf71
--- /dev/null
@@ -0,0 +1,24 @@
+# (c) 1999 Grzegorz Stanislawski <stangrze@open.net.pl>
+#
+# Script for dialing to host with 'modem level' callback serurity enabled 
+# as performed by USRobotics Courier modem 
+ABORT          BUSY
+ABORT          NO\\sDIAL
+ABORT          NO\\sCARRIER
+TIMEOUT                60
+''             atz
+OK             $INITSTRING
+OK             atdt $PHONE
+CONNECT                \\c
+\)?            $CBPASSWORD
+umber          $CBPHONE
+HANGUP                 OFF
+CLR_ABORT      NO\\sCARRIER
+NO\\sCARRIER   \\c
+TIMEOUT                120
+RING           ATA
+ABORT          NO\\sCARRIER
+CONNECT                \\c
+HANGUP                 ON
+ogin:          $USER
+assword:       $PASSWORD       
diff --git a/sysconfig/network-scripts/chat-ppp0.leased1 b/sysconfig/network-scripts/chat-ppp0.leased1
new file mode 100644 (file)
index 0000000..dbf4aec
--- /dev/null
@@ -0,0 +1,8 @@
+# (c) 1999 Grzegorz Stanislawski <stangrze@open.net.pl>
+# chat script for setting up hardwired (leased) serial line.
+# refer to ifcfg-ppp0.leased1 for more info 
+REPORT  CONNECT
+ABORT   'NO CARRIER'
+''              \\r$INITSTRING
+OK              ''
+CONNECT
diff --git a/sysconfig/network-scripts/chat-ppp0.tpsa b/sysconfig/network-scripts/chat-ppp0.tpsa
new file mode 100644 (file)
index 0000000..5a9c724
--- /dev/null
@@ -0,0 +1,13 @@
+# (c) 1999 Grzegorz Stanislawski <stangrze@open.net.pl>
+# Script for dialing in to Public Internet Access by TPSA (0202122)
+  
+ABORT          BUSY
+ABORT          NO\\sDIAL
+ABORT          NO\\sCARRIER
+TIMEOUT        60
+''             atz
+OK             $INITSTRING
+OK             atdt $PHONE
+CONNECT                \\c
+ame:           $USER
+ord:           $PASSWORD       
diff --git a/sysconfig/network-scripts/ifcfg-ppp0.callback b/sysconfig/network-scripts/ifcfg-ppp0.callback
new file mode 100644 (file)
index 0000000..0b10e3c
--- /dev/null
@@ -0,0 +1,25 @@
+DEVICE=ppp0
+CHATSCRIPT=chat-ppp0.callback
+ONBOOT=no
+HARDFLOWCTL=yes
+MODEMPORT=/dev/cua1
+LINESPEED=115200
+DEBUG=yes
+PERSIST=no
+HOLDOFF=10
+#demand option not finished yet ;-(
+DEMAND=no
+#ACTIVEFILTER=
+#IDLE=
+PHONE=phone
+INITSTRING=ATe0s2=255
+#CBPASSWORD and CBPHONE is ysed (by me) in callback. 
+#see included chat-ppp0 for example of
+#"modem level" callback (on USRobotics Courier)
+CBPASSWORD=cbpassword
+CBPHONE=myphone
+USER=user
+PASSWORD=password
+DATAFORCHAT="CBPASSWORD CBPHONE PHONE USER PASSWORD INITSTRING"
+
+REPORTFILE=/var/log/ppp0.log
diff --git a/sysconfig/network-scripts/ifcfg-ppp0.leased1 b/sysconfig/network-scripts/ifcfg-ppp0.leased1
new file mode 100644 (file)
index 0000000..eea67d1
--- /dev/null
@@ -0,0 +1,30 @@
+# (c) 1999 Grzegorz Stanislawski <stangrze@open.net.pl>
+# config file for setting up hardwired (leased) serial line.
+#  This configuration uses chats with modem, so You have to have an inteligent
+# modem (AT commands compatible).
+# But You can monitor connection speed.
+DEVICE=ppp0
+CHATSCRIPT=chat-ppp0.leased1
+ONBOOT=yes
+IPADDR=192.168.255.254
+REMIP=192.168.255.253
+NETMASK=255.255.255.252
+HARDFLOWCTL=yes
+MODEMPORT=/dev/cua1
+LINESPEED=115200
+DEBUG=no
+PERSIST=yes
+HOLDOFF=10
+#demand option not finished yet ;-(
+DEMAND=no
+#ACTIVEFILTER=
+#IDLE=
+# one end is "calling"
+INITSTRING="ATs0=0&l1"
+# while other is "receiving"
+#INITSTRING="ATs0=1&l1"
+#if your modem doesn't support AT&L1 command try with ATD on one side 
+#and ATA on the other. 
+DATAFORCHAT="INITSTRING"
+
+REPORTFILE=/var/log/ppp0.log
diff --git a/sysconfig/network-scripts/ifcfg-ppp0.leased2 b/sysconfig/network-scripts/ifcfg-ppp0.leased2
new file mode 100644 (file)
index 0000000..8d8489b
--- /dev/null
@@ -0,0 +1,29 @@
+# (c) 1999 Grzegorz Stanislawski <stangrze@open.net.pl>
+# config file for setting up hardwired (leased) serial line.
+#  This config assumes "transparent" modem (in ex. goramo), null modem
+# cable or current loop. 
+# Advantage is smaller logfiles and slower 'pid spinning' (no chat is
+# executed)
+# You can configure Your AT Hayes compatibile modem to transparent mode
+# using ATS0=0&L1&S5&W on master "calling" side and ATS0=1&L1&S5&W on
+# slave "reciving" side 
+# Note: After commiting last &W You won't be able to talk to Your modem 
+# until You reset it to factory defaults using some jumper.
+# if You don't have any jumper YOU HAVE BEEN WARNED. 
+DEVICE=ppp0
+ONBOOT=yes
+IPADDR=192.168.255.254
+REMIP=192.168.255.253
+NETMASK=255.255.255.252
+HARDFLOWCTL=yes
+MODEMPORT=/dev/cua1
+LINESPEED=115200
+DEBUG=no
+PERSIST=yes
+HOLDOFF=10
+#demand option not finished yet ;-(
+DEMAND=no
+#ACTIVEFILTER=
+#IDLE=
+
+REPORTFILE=/var/log/ppp0.log
diff --git a/sysconfig/network-scripts/ifcfg-ppp0.tpsa b/sysconfig/network-scripts/ifcfg-ppp0.tpsa
new file mode 100644 (file)
index 0000000..f764b1f
--- /dev/null
@@ -0,0 +1,20 @@
+DEVICE=ppp0
+CHATSCRIPT=chat-ppp0.tpsa
+ONBOOT=no
+HARDFLOWCTL=yes
+MODEMPORT=/dev/cua1
+LINESPEED=115200
+DEBUG=yes
+PERSIST=no
+HOLDOFF=10
+#demand option not finished yet ;-(
+DEMAND=no
+#ACTIVEFILTER=
+#IDLE=
+PHONE=0w202122
+USER=ppp
+PASSWORD=ppp
+INITSTRING=ATe0s2=255
+DATAFORCHAT="USER PASSWORD INITSTRING"
+
+REPORTFILE=/var/log/ppp0.log
index 2fb16acc57670db79f2cfc8e4dfa4ae686d24694..94fe55937961ddd7eaba3eaa81d3222fdbddd25c 100755 (executable)
@@ -1,18 +1,19 @@
-#!/bin/bash
+#!/bin/sh
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
 cd /etc/sysconfig/network-scripts
-
 . network-functions
 
 CONFIG=$1
 
 [ -z "$CONFIG" ] && {
+    echo "usage: ifdown <device name>" >&2
     exit 1
 }
 
 [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
 [ -f "$CONFIG" ] || {
+    echo "usage: ifdown <device name>" >&2
     exit 1
 }
 
@@ -48,16 +49,8 @@ if [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then
        fi
        exit 1
 fi
-# IPv6 section
-if [ -f /etc/rc.d/init.d/functions-ip6 ]; then
-       . /etc/rc.d/init.d/functions-ip6
-
-       ifdown-routes-ip6 ${DEVICE}
-       ifdown-ip6 ${DEVICE}
-fi
 
 ifconfig ${DEVICE} down
 
 exec /etc/sysconfig/network-scripts/ifdown-post $CONFIG
 
-echo $0 $1 executed...
index 687c40414e41e501c2ee03ee41b497c8c227e789..5ef7c29348d1fd4c529d379b7362e7aa742e4a7f 100755 (executable)
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/bin/sh
 # This should be called whenever an interface goes down, not just when
 # it is brought down explicitly.
 
 cd /etc/sysconfig/network-scripts
+. network-functions
 
 CONFIG=$1
-. network-functions
 source_config
 
 # Notify programs that have requested notification
index 299fb8a9c671989357e571d7cbfc4f6fd46174ae..7fa0cf5f932b1f376eb7e8c27c0a4ebd16aa4696 100755 (executable)
@@ -2,9 +2,9 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
 cd /etc/sysconfig/network-scripts
+. network-functions
 
 CONFIG=$1
-. network-functions
 source_config
 
 if [ ! -f /var/run/ppp-$DEVICE.dev ]; then
@@ -30,7 +30,7 @@ fi
 # pppd might have chat as a child; remember chat's pid to kill after pppd.
 # (After, not before, so that pppd doesn't just restart it).
 
-CHATPID=`ps aul | awk '$4 ~ $PID {print $3}' 2>/dev/null`
+CHATPID=`ps axl | awk '$4 ~ $PID {print $3}' 2>/dev/null`
 
 kill $PID > /dev/null 2>&1
 [ -n "$CHATPID" ] && kill $CHATPID > /dev/null 2>&1
index ea9bae619b8c40d59f8fa0112de0d90cc78f0c35..0bb9d425b0217d4d16b7f812c4116e77cd0dd95b 100755 (executable)
@@ -2,15 +2,23 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
 cd /etc/sysconfig/network-scripts
+. network-functions
 
 CONFIG=$1
-. network-functions
 source_config
 
 # signals ifup-sl not to persist
 rm -f /var/run/sl-$DEVICE.dev
 
 PID=`pidof dip-$DEVICE`
+#
+# The proctitle for connected dip daemons is actually "-dip (ipaddr)"
+#      with ipaddr == local on dial-out,  remote on dial-in
+# Grab the PID of connected dial-out daemon.
+#
+if [ -z "$PID" ]; then
+  PID=`pidof -- -dip\ \($IPADDR\)`
+fi
 if [ -z "$PID" ]; then
   exit 1
 fi
index b64d72a4921f828b4bb9e25ea10271b7bbb1a281..5762a9fadc2ae6ed9d95493657050032b6090ea6 100755 (executable)
@@ -2,7 +2,6 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
 cd /etc/sysconfig/network-scripts
-
 . network-functions
 
 need_hostname
@@ -10,11 +9,13 @@ need_hostname
 CONFIG=$1
 
 [ -z "$CONFIG" ] && {
+    echo "usage: ifup <device name>" >&2
     exit 1
 }
 
 [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
 [ -f "$CONFIG" ] || {
+    echo "usage: ifup <device name>" >&2
     exit 1
 }
 
@@ -128,16 +129,23 @@ if [ "$IPSETUP" != yes ]; then
 
     ifconfig ${DEVICE} ${MACADDR:+hw ether $MACADDR} ${IPADDR} \
       netmask ${NETMASK} broadcast ${BROADCAST}
-    if [ "$ISALIAS" != no ] ; then
+    if [ "$ISALIAS" = no ] ; then
+       route add -net ${NETWORK} netmask ${NETMASK} ${DEVICE}
+    else
        route add -host ${IPADDR} ${DEVICE}
     fi
 
+    # this is broken! it's only here for compatibility with old RH systems
+    if [ "${GATEWAY}" != "" -a "${GATEWAY}" != "none" ]; then
+       route add default gw ${GATEWAY} metric 1 ${DEVICE}
+    fi
+
     . /etc/sysconfig/network
 
     if [ "${GATEWAY}" != "" ]; then
        if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
            # set up default gateway
-           route add default gw ${GATEWAY} dev ${DEVICE} 
+           route add default gw ${GATEWAY} ${DEVICE}
            DEFGW=${GATEWAY}
        fi
     fi
@@ -146,7 +154,7 @@ if [ "$IPSETUP" != yes ]; then
        if [ -n "$GATEWAYS" ]; then
            for gw in $GATEWAYS; do
                if [ $gw != "${DEFGW}" ]; then
-                   route add default gw $gw dev ${DEVICE}
+                   route add default gw $gw ${DEVICE}
                fi
            done
        fi
@@ -163,18 +171,9 @@ if [ "$IPSETUP" != yes ]; then
        fi
     fi
 fi
-# IPv6 section
-if [ -f /etc/rc.d/init.d/functions-ip6 ]; then
-       . /etc/rc.d/init.d/functions-ip6
-       ifup-ip6 ${DEVICE}
-       ifup-routes-ip6 ${DEVICE}
-fi
 
-case $CONFIG in
-  eth*)
-       /etc/sysconfig/network-scripts/ifup-ipx $CONFIG
-       ;;
-esac
+if [ "$IPX" = yes ]; then
+       /etc/sysconfig/network-scripts/ifup-ipx $DEVICE
+fi
 
 exec /etc/sysconfig/network-scripts/ifup-post $CONFIG
-echo $0 $1 executing...
index d8141602406137597f29031c9a04cc37d7ef92b4..cd325f2565edfe35946ffb83131e72064942d8d8 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # adds aliases of device $1
 
@@ -7,34 +7,8 @@ if [ "$1" = "" ]; then
        exit 1
 fi
 
-if [ -x /bin/linuxconf ] ; then
-    # ask linuxconf for lines like:
-    # add      <device>        <ip>
-    # del      <device>
-    # reload   <number_of_aliases>
-    linuxconf --hint ipalias $1 | while read verb arg1 arg2 ; do
-       case $verb in
-         add)
-               /sbin/ifconfig $arg1 $arg2
-               /sbin/route add $arg2 $arg1
-               ;;
-         del)
-               # the <device>- 0.0.0.0 tells the kernel to remove the device
-               # it is necessary to remove it in order for reload to work.
-               /sbin/ifconfig ${arg1}- 0.0.0.0
-               ;;
-         reload)
-               echo $arg1 > /proc/sys/net/core/net_alias_max
-               ;;
-       esac
-    done
-
-else
-    # we don't have linuxconf to fall back on, so presumably we do
-    # not have to parse linuxconf ipalias ranges, either.
-    allow_null_glob_expansion=foo
-    for alias in /etc/sysconfig/network-scripts/ifcfg-$1:* ; do
-       /etc/sysconfig/network-scripts/ifup $alias
-    done
-    unset allow_null_glob_expansion
-fi
+allow_null_glob_expansion=foo
+for alias in /etc/sysconfig/network-scripts/ifcfg-$1:* ; do
+    /etc/sysconfig/network-scripts/ifup $alias
+done
+unset allow_null_glob_expansion
index b04fda67be17e814427cb3bbbf2cab7702c3f380..1a966ad3d9f26ec574286ac23f9ca54e6820367a 100755 (executable)
@@ -18,10 +18,10 @@ fi
 case $IPX in yes|true) ;; *) exit 0 ;; esac
 
 cd /etc/sysconfig/network-scripts
-
 . network-functions
 
 CONFIG=$1
+[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
 source_config
 
 for frametype in 802_2 802_3 ETHERII SNAP ; do
index 5e7e7836f669e387600bcaa99212a545db535040..25c36feaa323c2e84c124cf8a68776af25cdb230 100755 (executable)
@@ -1,8 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
-CONFIG=$1
+cd /etc/sysconfig/network-scripts
 . network-functions
+
+CONFIG=$1
 source_config
 
 if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" ]
index 1b345e28eb06c52188052970257f7b1a09288fea..789afd1240fd27e088923d321242af5b64d6699e 100755 (executable)
@@ -1,11 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 
 cd /etc/sysconfig/network-scripts
-
-CONFIG=$1
 . network-functions
 
 need_hostname
+CONFIG=$1
 source_config
 
 DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"`
index e46240b97dc44797656b4cabdab88fe25afd7e00..f85359dc2e487458dc3d8d2aa00b708e867ee43f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # ifup-ppp script for pppd-2.3.5 (with persist & demand options) ver 0.2
 # Grzegorz Stanislawski <stangrze@open.net.pl>
@@ -41,6 +41,13 @@ fi
     "/usr/sbin/pppd does not exist or is not executable for $DEVICE"
   exit 1
 }
+#[ -f /etc/sysconfig/network-scripts/chat-$DEVICE ] || {
+#  echo "/etc/sysconfig/network-scripts/chat-$DEVICE does not exist"
+#  echo "ifup-ppp for $DEVICE exiting"
+#  logger -p daemon.info -t ifup-ppp \
+#    "/etc/sysconfig/network-scripts/chat-$DEVICE does not exist for $DEVICE"
+#  exit 1
+#}
 opts="lock"
 if [ "${PERSIST}" = "yes" ]; then
   opts="$opts persist holdoff $HOLDOFF"
@@ -78,15 +85,19 @@ fi
 if [ -n "${REPORTFILE}"  ] ; then
   chatrpt="-r ${REPORTFILE}"
 fi
+#CHATSCRIPT=/etc/sysconfig/network-scripts/chat-$DEVNAMR
+#[ -f $CHATSCRIPT ] || {
+#  CHATSCRIPT=/etc/sysconfig/network-scripts/chat-$PARENTDEVNAME
+#}
+> /var/run/ppp-$DEVICE.dev
 (logger -p daemon.info -t ifup-ppp \
     "pppd started for $DEVICE on $MODEMPORT at $LINESPEED" &)&
-> /var/run/ppp-$DEVICE.dev
-
 if [ -n "${CHATSCRIPT}"  ] ; then
   export chatdbg chatrpt CHATSCRIPT
   export $DATAFORCHAT
   /usr/sbin/pppd -detach $opts $MODEMPORT $LINESPEED \
-    connect 'eval /usr/sbin/chat $chatdbg $chatrpt `cat ${CHATSCRIPT}`' \
+    connect 'eval /usr/sbin/chat $chatdbg $chatrpt \
+    `grep -v ^# ${CHATSCRIPT}`' \
     remotename $DEVICE ipparam $DEVICE \
     ${PPPOPTIONS} &
 else
index 8902e10643967e87ff1af9f449209182e4256b0c..eb4094ca42ad23aeb9527dc00429cfbd737fc300 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # adds static routes which go through device $1
 
@@ -7,52 +7,10 @@ if [ "$1" = "" ]; then
        exit 1
 fi
 
-if [ -x /bin/linuxconf ] ; then
-       linuxconf --hint routing "$1" | while read args; do
-           /sbin/route $args
-       done
-else
-       if [ ! -f /etc/sysconfig/static-routes ]; then
-               exit 0
-       fi
-
-       #note the trailing space in the grep gets rid of aliases
-       grep "^$1 " /etc/sysconfig/static-routes | while read device args; do
-           /sbin/route add -$args $device
-       done
-fi
-#!C:Changes for forwarding switch copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
-#!V:Version: 1.10 18.04.1998
-#
-# Changes from:
-# 1.09: add forwarding switch for kernel versions >= 2.1.90 (idea by Dan Anderson anderson@computer.org)
-
-
-
-## Switch on forwarding in the kernel
-
-PROC_IPFORWARD="`ls /proc/sys/net/ipv4/ip_forward* 2>/dev/null`"
-
-if ! [ "$PROC_IPFORWARD" = "" ]; then
-    # Forwarding exists in kernel
-    if ! [ "`cat $PROC_IPFORWARD`" = "1" ]; then
-       # switched off
-        echo " Switch on IPv4 forwarding in the kernel"
-       echo "1" >$PROC_IPFORWARD
-    fi
-fi
-
-if [ -f /proc/sys/net/ipv4/conf/all/forwarding ]; then
-    # for kernel >= 2.1.90
-    for i in /proc/sys/net/ipv4/conf/*/forwarding; do
-        if ! [ "`cat $i`" = "1" ]; then
-           device=`echo $i | cut -d / -f 7` 
-           echo "  Switch on IPv4 forwarding for device '$device' in the kernel"
-            echo "1" > $i
-       fi
-    done
+if [ ! -f /etc/sysconfig/static-routes ]; then
+    exit 0
 fi
-
-## End of switch on forwarding in the kernel
-
-
+#note the trailing space in the grep gets rid of aliases
+grep "^$1 " /etc/sysconfig/static-routes | while read device args; do
+    /sbin/route add -$args $device
+done
index 9173da24d36d2d986065869f0a500e678b241199..c39f5d4ed364d0bb1c8e9f20d57e22df74ee168f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
 # ifup-post can't be done for slip :-( Solution: use PPP
@@ -12,8 +12,10 @@ if [ "$1" != daemon ] ; then
 fi
 shift
 
-CONFIG=$1
+cd /etc/sysconfig/network-scripts
 . network-functions
+
+CONFIG=$1
 source_config
 
 if [ "foo$2" = "fooboot" -a ${ONBOOT} = "no" ]
diff --git a/sysconfig/network-scripts/tnlcfg-icm b/sysconfig/network-scripts/tnlcfg-icm
new file mode 100644 (file)
index 0000000..d54c778
--- /dev/null
@@ -0,0 +1,23 @@
+MODE={ipip|gre|sit|ipxip}
+DEVICE=<device name>
+if     MODE=ipxip ; then
+       ?
+else   MODE=ipip || MODE=gre || MODE=sit ; then
+
+       REMOTEADDR=<IPv4 addres>
+       [ LOCALADDR=<IPv4 addres> ]
+       [ REALDEVICE=<name of physic device>
+       [ TTL= ]
+       [ TOS= ]
+       [ SEQ={no|yes} ]
+       [ ISEQ={no|yes} ]
+       [ OSEQ={no|yes} ]
+       [ KEY= ]
+       [ IKEY= ]
+       [ OKEY= ]
+       [ CSUM={no|yes} ]
+       [ ICSUM={no|yes} ]
+       [ OCSUM={no|yes} ]
+       [ NOPMTUDISC={no|yes} ]
+fi
+       
diff --git a/sysconfig/tunnels-ip6.conf b/sysconfig/tunnels-ip6.conf
new file mode 100644 (file)
index 0000000..1b71f70
--- /dev/null
@@ -0,0 +1,53 @@
+#!F:tunnels-ip6.conf
+#
+#!P:/etc/sysconfig
+#
+#!S:root:root 440
+#
+#!D:IPv6 configuration file
+#
+#!C:Copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
+#!C:changes (versions X.XXa) by Grzegorz Stanislawski <stangrze@open.net.pl>
+#
+#!V:Version 2.12a 10.11.1998
+
+# Changes to 
+#  2.11: nothing important
+#  2.12: NBMA tunnel configuration ready
+#  2.12a:
+#    - this file contains data which was moved from network-ip6.conf
+#    - Support for verbose interface names (see network-ip6.conf for info)
+#    - removed nbma suppport (since i cannot imagine what is this for - (stangrze))
+# This file is needed by 'functions-ip6' version 2.41a
+
+### The order in the file is only for a good overview, it is not really
+### necessary. The important values are 'device' and 'key'!
+
+
+################# Tunnel section 
+
+## Here you can configure tunnel endpoints. Be sure, that you set the device
+## entry in a right way like 'sit1', 'sit2' and so on, otherwise you will get
+## an error information from 'functions-ip6'
+
+#Device        Key     local           remote          ttl     realdev
+icm-pl tunnel  195.136.100.3   193.219.28.246  64      eth0
+ceti   tunnel  195.136.100.3   195.116.211.16  64      eth0
+ckm    tunnel  195.136.100.3   195.136.5.6     64      eth0
+wiget  tunnel  195.136.100.3   156.17.210.110  64      eth0
+#sit2  tunnel                          IPv4-Address
+#sit3  tunnel                          IPv4-Address
+
+
+# Tunnel route section 
+# Here you can specify several routes to your configured tunnels.
+# More than one are possible!
+
+#Device        Key                             Network
+icm-pl route                           3ffe:902::/32
+ceti   route                           3ffe:902:3::/48
+ckm    route                           3ffe:902:10::1:0/112
+wiget  route                           3ffe:902:11::/48
+#sit2  route                           IPv6-Network/Prefix
+#sit3  route                           IPv6-Network/Prefix
+
diff --git a/sysvinitfiles b/sysvinitfiles
new file mode 100644 (file)
index 0000000..9e9ddeb
--- /dev/null
@@ -0,0 +1,181 @@
+Writing System V init scripts for Red Hat Linux
+===============================================
+
+All System V init scripts are named /etc/rc.d/init.d/<servicename>
+where <servicename> is the name of the service.  There must be no
+".init" suffix.
+
+
+Sample Script
+=============
+
+#!/bin/bash
+#
+#      /etc/rc.d/init.d/<servicename>
+#
+#      <description of the *service*>
+#      <any general comments about this init script>
+#
+# <tags -- see below for tag definitions.  *Every line* from the top
+#  of the file to the end of the tags section must begin with a #
+#  character.  After the tags section, there should be a blank line.
+#  This keeps normal comments in the rest of the file from being
+#  mistaken for tags, should they happen to fit the pattern.>
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+<define any local shell functions used by the code that follows>
+
+case "$1" in
+    start)
+       echo -n "Starting <servicename> services: "
+       <start daemons, perhaps with the daemon function>
+       touch /var/lock/subsys/<servicename>
+       ;;
+    stop)
+       echo -n "Shutting down <servicename> services: "
+       <stop daemons, perhaps with the killproc function>
+       rm -f /var/lock/subsys/<servicename>
+       ;;
+    status)
+       <report the status of the daemons in free-form format,
+       perhaps with the status function>
+       ;;
+    restart)
+       <restart the daemons, normally with $0 stop; $0 start>
+       ;;
+    reload)
+       <cause the service configuration to be reread, either with
+       kill -HUP or by restarting the daemons, possibly with
+       $0 stop; $0 start>
+       ;;
+    probe)
+       <optional.  If it exists, then it should determine whether
+       or not the service needs to be restarted or reloaded (or
+       whatever) in order to activate any changes in the configuration
+       scripts.  It should print out a list of commands to give to
+       $0; see the description under the probe tag below.>
+       ;;
+    *)
+       echo "Usage: <servicename> {start|stop|status|reload|restart[|probe]"
+       exit 1
+       ;;
+esac
+
+
+Notes: the restart and reload functions may be (and commonly are)
+combined into one test, vis:
+    restart|reload)
+You are not prohibited from adding other commands; list all commands
+which you intend to be used interactively to the usage message.
+
+
+
+Functions in /etc/rc.d/init.d/functions
+=======================================
+
+daemon [+/-nicelevel] program [arguments] [&]
+
+       Starts a daemon, if it is not already running.  Does
+       other useful things like keeping the daemon from dumping
+       core if it terminates unexpectedly.
+
+killproc program [signal]
+
+       Sends a signal to the program; by default it sends a SIGTERM,
+       and if the process doesn't die, it sends a SIGKILL a few
+       seconds later.
+
+       It also tries to remove the pidfile, if it finds one.
+
+pidofproc program
+
+       Tries to find the pid of a program; checking likely pidfiles,
+       using the pidof program, or even using ps.  Used mainly from
+       within other functions in this file, but also available to
+       scripts.
+
+status program
+
+       Prints status information.  Assumes that the program name is
+       the same as the servicename.
+
+
+Tags
+====
+
+# chkconfig: <startlevellist> <startpriority> <endpriority>
+
+       Required.  <startlevellist> is a list of levels in which
+       the service should be started by default.  <startpriority>
+       and <endpriority> are priority numbers.  For example:
+       # chkconfig: 2345 20 80
+       Read 'man chkconfig' for more information.
+
+       Unless there is a VERY GOOD, EXPLICIT reason to the
+       contrary, the <endpriority> should be equal to
+       100 - <startpriority>
+
+# description: <multi-line description of service>
+
+       Required.  Several lines of description, continued with '\'
+       characters.  The initial comment and following whitespace
+       on the following lines is ignored.
+
+# description[ln]: <multi-line description of service in the language \
+#                  ln, whatever that is>
+
+       Optional.  Should be the description translated into the
+       specified language.
+
+# processname:
+
+       Optional, multiple entries allowed.  For each process name
+       started by the script, there should be a processname entry.
+       For example, the samba service starts two daemons:
+       # processname: smdb
+       # processname: nmdb
+
+# config:
+
+       Optional, multiple entries allowed.  For each static config
+       file used by the daemon, use a single entry.  For example:
+       # config: /etc/httpd/conf/httpd.conf
+       # config: /etc/httpd/conf/srm.conf
+
+       Optionally, if the server will automatically reload the config
+       file if it is changed, you can append the word "autoreload" to
+       the line:
+       # config: /etc/foobar.conf autoreload
+
+# pidfile:
+
+       Optional, multiple entries allowed.  Use just like the config
+       entry, except that it points at pidfiles.  It is assumed that
+       the pidfiles are only updated at process creation time, and
+       not later.  The first line of this file should be the ASCII
+       representation of the PID; a terminating newline is optional.
+       Any lines other than the first line are not examined.
+
+# probe: true
+
+       Optional, used IN PLACE of processname, config, and pidfile.
+       If it exists, then a proper reload-if-necessary cycle may be
+       acheived by running these commands:
+
+       command=$(/etc/rd.d/init.d/SCRIPT probe)
+       [ -n "$command" ] && /etc/rc.d/init.d/SCRIPT $command
+
+       where SCRIPT is the name of the service's sysv init script.
+
+       Scripts that need to do complex processing could, as an
+       example, return "run /var/tmp/<servicename.probe.$$"
+       and implement a "run" command which would execute the
+       named script and then remove it.
+
+       Note that the probe command should simply "exit 0" if nothing
+       needs to be done to bring the service into sync with its
+       configuration files.
+
+Copyright (c) 1998 Red Hat Software, Inc.
This page took 0.228614 seconds and 4 git commands to generate.