From 12de71bee4d20c8c8c7af6e950aedbb59d7d2876 Mon Sep 17 00:00:00 2001 From: stangrze Date: Mon, 14 Jun 1999 20:08:17 +0000 Subject: [PATCH] Synced with rc-scripts-0.0.1 from old repo. svn-id: @362 --- Makefile | 20 +- inittab | 9 +- inputrc | 3 + lang.sh | 40 +++- rc-scripts.spec | 125 +++++++++++ rc.d/init.d/functions | 57 ++--- rc.d/init.d/functions-ip6 | 204 ++++++++++++------ rc.d/init.d/halt | 67 ++---- rc.d/init.d/killall | 2 +- rc.d/init.d/network | 185 +++++++--------- rc.d/init.d/network-ip6.init | 137 ++++++++++++ rc.d/init.d/nfsfs | 2 +- rc.d/init.d/random | 4 +- rc.d/init.d/reboot | 25 +++ rc.d/init.d/shutdwn | 40 ++++ rc.d/init.d/single | 48 +++-- rc.d/init.d/tunnels-ip6.init | 131 +++++++++++ rc.d/rc | 10 +- rc.d/rc.local | 7 - rc.d/rc.serial | 12 +- rc.d/rc.sysinit | 103 +++++---- src/Makefile | 26 +-- src/usernetctl.c | 15 +- sysconfig.txt | 65 ++++-- sysconfig/network-ip6 | 41 ++-- sysconfig/network-ip6.conf | 42 ++-- sysconfig/network-scripts/chat-ppp0.callback | 24 +++ sysconfig/network-scripts/chat-ppp0.leased1 | 8 + sysconfig/network-scripts/chat-ppp0.tpsa | 13 ++ sysconfig/network-scripts/ifcfg-ppp0.callback | 25 +++ sysconfig/network-scripts/ifcfg-ppp0.leased1 | 30 +++ sysconfig/network-scripts/ifcfg-ppp0.leased2 | 29 +++ sysconfig/network-scripts/ifcfg-ppp0.tpsa | 20 ++ sysconfig/network-scripts/ifdown | 13 +- sysconfig/network-scripts/ifdown-post | 4 +- sysconfig/network-scripts/ifdown-ppp | 4 +- sysconfig/network-scripts/ifdown-sl | 10 +- sysconfig/network-scripts/ifup | 31 ++- sysconfig/network-scripts/ifup-aliases | 38 +--- sysconfig/network-scripts/ifup-ipx | 2 +- sysconfig/network-scripts/ifup-plip | 6 +- sysconfig/network-scripts/ifup-post | 5 +- sysconfig/network-scripts/ifup-ppp | 19 +- sysconfig/network-scripts/ifup-routes | 56 +---- sysconfig/network-scripts/ifup-sl | 6 +- sysconfig/network-scripts/tnlcfg-icm | 23 ++ sysconfig/tunnels-ip6.conf | 53 +++++ sysvinitfiles | 181 ++++++++++++++++ 48 files changed, 1447 insertions(+), 573 deletions(-) create mode 100644 inputrc create mode 100644 rc-scripts.spec create mode 100755 rc.d/init.d/network-ip6.init create mode 100755 rc.d/init.d/reboot create mode 100755 rc.d/init.d/shutdwn create mode 100755 rc.d/init.d/tunnels-ip6.init create mode 100644 sysconfig/network-scripts/chat-ppp0.callback create mode 100644 sysconfig/network-scripts/chat-ppp0.leased1 create mode 100644 sysconfig/network-scripts/chat-ppp0.tpsa create mode 100644 sysconfig/network-scripts/ifcfg-ppp0.callback create mode 100644 sysconfig/network-scripts/ifcfg-ppp0.leased1 create mode 100644 sysconfig/network-scripts/ifcfg-ppp0.leased2 create mode 100644 sysconfig/network-scripts/ifcfg-ppp0.tpsa create mode 100644 sysconfig/network-scripts/tnlcfg-icm create mode 100644 sysconfig/tunnels-ip6.conf create mode 100644 sysvinitfiles diff --git a/Makefile b/Makefile index a606d03c..dd527e1b 100644 --- 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 778edd55..c2a4d7a8 100644 --- a/inittab +++ b/inittab @@ -4,7 +4,7 @@ # # Author: Miquel van Smoorenburg, # 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 index 00000000..b06d8b4b --- /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 6233b0c8..91eb3f68 100755 --- 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 index 00000000..a45d8f04 --- /dev/null +++ b/rc-scripts.spec @@ -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 + [0.0.1] +- Full changelog in PLD's CVS. +- First Release. +- Package based on RedHat's initscripts-3.78. diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 336c7197..d34c5f3f 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -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, # Hacked by: Greg Galloway and Marc Ewing @@ -11,43 +9,32 @@ # # 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 diff --git a/rc.d/init.d/functions-ip6 b/rc.d/init.d/functions-ip6 index 7c541035..3bd8e94d 100644 --- a/rc.d/init.d/functions-ip6 +++ b/rc.d/init.d/functions-ip6 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # #!F:functions-ip6 # @@ -11,28 +11,48 @@ # tunnels-up-ip6, tunnels-down-ip6 # #!C:Copyright 1997-1998 Peter Bieringer +#!C:some code by Gregorz Stanislawski # -#!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 1 + 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 " 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 1 + 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 " 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 1 + 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 " return 1 fi @@ -450,7 +505,7 @@ function ifdown-ip6() if [ "$1" = "lo" ]; then return 0; fi # Run IPv6 test - test-ip6 || return 1 + 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 } diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 82625c69..0daec3d0 100644 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -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, -# 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 # - -# 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 - diff --git a/rc.d/init.d/killall b/rc.d/init.d/killall index 9d244119..7529bf78 100644 --- a/rc.d/init.d/killall +++ b/rc.d/init.d/killall @@ -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) diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 42c0e701..03243282 100644 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -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 index 00000000..d07bf540 --- /dev/null +++ b/rc.d/init.d/network-ip6.init @@ -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 +## 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 +# +# 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 + diff --git a/rc.d/init.d/nfsfs b/rc.d/init.d/nfsfs index 71c97d3b..b1a97531 100644 --- a/rc.d/init.d/nfsfs +++ b/rc.d/init.d/nfsfs @@ -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.*) diff --git a/rc.d/init.d/random b/rc.d/init.d/random index 52c058fa..53dfc814 100644 --- a/rc.d/init.d/random +++ b/rc.d/init.d/random @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # random Script to snapshot random state and reload it at boot time. # # Author: Theodore Ts'o # -# 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 index 00000000..6441a6ef --- /dev/null +++ b/rc.d/init.d/reboot @@ -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 +# + +# 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 index 00000000..aa961dbc --- /dev/null +++ b/rc.d/init.d/shutdwn @@ -0,0 +1,40 @@ +#!/bin/sh +# +# shutdwn Common script for system halt/reboot. +# +# Author: Miquel van Smoorenburg, +# 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 diff --git a/rc.d/init.d/single b/rc.d/init.d/single index 222e4b88..f31b06c1 100644 --- a/rc.d/init.d/single +++ b/rc.d/init.d/single @@ -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, -# 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 index 00000000..712c877e --- /dev/null +++ b/rc.d/init.d/tunnels-ip6.init @@ -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 +## 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 +# +# 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 4b3dd644..a1194c37 100755 --- 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 ] || \ diff --git a/rc.d/rc.local b/rc.d/rc.local index 73f8381e..fdf5c9cc 100755 --- a/rc.d/rc.local +++ b/rc.d/rc.local @@ -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 - diff --git a/rc.d/rc.serial b/rc.d/rc.serial index 3d4a84ee..5176cbaa 100755 --- a/rc.d/rc.serial +++ b/rc.d/rc.serial @@ -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 diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 1ce0c75a..78bcb994 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -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 diff --git a/src/Makefile b/src/Makefile index 0afb4284..c0e3f573 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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 diff --git a/src/usernetctl.c b/src/usernetctl.c index bad10c96..5a228bdc 100644 --- a/src/usernetctl.c +++ b/src/usernetctl.c @@ -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; diff --git a/sysconfig.txt b/sysconfig.txt index 2cf34705..3c9aabba 100644 --- a/sysconfig.txt +++ b/sysconfig.txt @@ -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= GATEWAYDEV= (e.g. eth0) NISDOMAIN= @@ -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= (time to wait before re-attempting to establish a connection after a previous attempt fails.) + INITSCRIPT= + string which initialises your modem. Usualy something like + AT&F0&C1&D2 + (PLD rc-scripts specific option) + DATAFORCHAT= + 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) + = + 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-: @@ -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- 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- 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 - diff --git a/sysconfig/network-ip6 b/sysconfig/network-ip6 index 945f6f5e..32aa6a89 100644 --- a/sysconfig/network-ip6 +++ b/sysconfig/network-ip6 @@ -5,21 +5,21 @@ #!D:IPv6 network configuration file # #!C:Copyright 1997-1998 Peter Bieringer +#!C:changes (versions X.XXa) by Grzegorz Stanislawski # -#!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 diff --git a/sysconfig/network-ip6.conf b/sysconfig/network-ip6.conf index 705b26fe..fe92dfe0 100644 --- a/sysconfig/network-ip6.conf +++ b/sysconfig/network-ip6.conf @@ -2,14 +2,23 @@ # #!P:/etc/sysconfig # +#!S:root:root 440 +# #!D:IPv6 configuration file # #!C:Copyright 1997-1998 Peter Bieringer +#!C:changes (versions X.XXa) by Grzegorz Stanislawski # -#!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 @@ -17,33 +26,14 @@ ### 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 index 00000000..27daf719 --- /dev/null +++ b/sysconfig/network-scripts/chat-ppp0.callback @@ -0,0 +1,24 @@ +# (c) 1999 Grzegorz Stanislawski +# +# 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 index 00000000..dbf4aecd --- /dev/null +++ b/sysconfig/network-scripts/chat-ppp0.leased1 @@ -0,0 +1,8 @@ +# (c) 1999 Grzegorz Stanislawski +# 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 index 00000000..5a9c724f --- /dev/null +++ b/sysconfig/network-scripts/chat-ppp0.tpsa @@ -0,0 +1,13 @@ +# (c) 1999 Grzegorz Stanislawski +# 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 index 00000000..0b10e3c4 --- /dev/null +++ b/sysconfig/network-scripts/ifcfg-ppp0.callback @@ -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 index 00000000..eea67d11 --- /dev/null +++ b/sysconfig/network-scripts/ifcfg-ppp0.leased1 @@ -0,0 +1,30 @@ +# (c) 1999 Grzegorz Stanislawski +# 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 index 00000000..8d8489b2 --- /dev/null +++ b/sysconfig/network-scripts/ifcfg-ppp0.leased2 @@ -0,0 +1,29 @@ +# (c) 1999 Grzegorz Stanislawski +# 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 index 00000000..f764b1f6 --- /dev/null +++ b/sysconfig/network-scripts/ifcfg-ppp0.tpsa @@ -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 diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index 2fb16acc..94fe5593 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -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 " >&2 exit 1 } [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG [ -f "$CONFIG" ] || { + echo "usage: ifdown " >&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... diff --git a/sysconfig/network-scripts/ifdown-post b/sysconfig/network-scripts/ifdown-post index 687c4041..5ef7c293 100755 --- a/sysconfig/network-scripts/ifdown-post +++ b/sysconfig/network-scripts/ifdown-post @@ -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 diff --git a/sysconfig/network-scripts/ifdown-ppp b/sysconfig/network-scripts/ifdown-ppp index 299fb8a9..7fa0cf5f 100755 --- a/sysconfig/network-scripts/ifdown-ppp +++ b/sysconfig/network-scripts/ifdown-ppp @@ -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 diff --git a/sysconfig/network-scripts/ifdown-sl b/sysconfig/network-scripts/ifdown-sl index ea9bae61..0bb9d425 100755 --- a/sysconfig/network-scripts/ifdown-sl +++ b/sysconfig/network-scripts/ifdown-sl @@ -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 diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index b64d72a4..5762a9fa 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -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 " >&2 exit 1 } [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG [ -f "$CONFIG" ] || { + echo "usage: ifup " >&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... diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases index d8141602..cd325f25 100755 --- a/sysconfig/network-scripts/ifup-aliases +++ b/sysconfig/network-scripts/ifup-aliases @@ -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 - # del - # reload - 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 - 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 diff --git a/sysconfig/network-scripts/ifup-ipx b/sysconfig/network-scripts/ifup-ipx index b04fda67..1a966ad3 100755 --- a/sysconfig/network-scripts/ifup-ipx +++ b/sysconfig/network-scripts/ifup-ipx @@ -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 diff --git a/sysconfig/network-scripts/ifup-plip b/sysconfig/network-scripts/ifup-plip index 5e7e7836..25c36fea 100755 --- a/sysconfig/network-scripts/ifup-plip +++ b/sysconfig/network-scripts/ifup-plip @@ -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" ] diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index 1b345e28..789afd12 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -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]*$//"` diff --git a/sysconfig/network-scripts/ifup-ppp b/sysconfig/network-scripts/ifup-ppp index e46240b9..f85359dc 100755 --- a/sysconfig/network-scripts/ifup-ppp +++ b/sysconfig/network-scripts/ifup-ppp @@ -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 @@ -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 diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes index 8902e106..eb4094ca 100755 --- a/sysconfig/network-scripts/ifup-routes +++ b/sysconfig/network-scripts/ifup-routes @@ -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 -#!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 diff --git a/sysconfig/network-scripts/ifup-sl b/sysconfig/network-scripts/ifup-sl index 9173da24..c39f5d4e 100755 --- a/sysconfig/network-scripts/ifup-sl +++ b/sysconfig/network-scripts/ifup-sl @@ -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 index 00000000..d54c7789 --- /dev/null +++ b/sysconfig/network-scripts/tnlcfg-icm @@ -0,0 +1,23 @@ +MODE={ipip|gre|sit|ipxip} +DEVICE= +if MODE=ipxip ; then + ? +else MODE=ipip || MODE=gre || MODE=sit ; then + + REMOTEADDR= + [ LOCALADDR= ] + [ REALDEVICE= + [ 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 index 00000000..1b71f70a --- /dev/null +++ b/sysconfig/tunnels-ip6.conf @@ -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 +#!C:changes (versions X.XXa) by Grzegorz Stanislawski +# +#!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 index 00000000..9e9ddeb7 --- /dev/null +++ b/sysvinitfiles @@ -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/ +where is the name of the service. There must be no +".init" suffix. + + +Sample Script +============= + +#!/bin/bash +# +# /etc/rc.d/init.d/ +# +# +# +# +# + +# Source function library. +. /etc/rc.d/init.d/functions + + + +case "$1" in + start) + echo -n "Starting services: " + + touch /var/lock/subsys/ + ;; + stop) + echo -n "Shutting down services: " + + rm -f /var/lock/subsys/ + ;; + status) + + ;; + restart) + + ;; + reload) + + ;; + probe) + + ;; + *) + echo "Usage: {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: + + Required. is a list of levels in which + the service should be started by default. + and 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 should be equal to + 100 - + +# description: + + Required. Several lines of description, continued with '\' + characters. The initial comment and following whitespace + on the following lines is ignored. + +# description[ln]: + + 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/