From a145ddda284570e57413e37f025c3657205e17d8 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Fri, 25 May 2018 20:01:54 +0200 Subject: Repository scheme updated to new layout NOTE: This commit just moves files around, without actually fixing the Makefiles and specfile. See follow up commits which resolve this. --- NetworkManager/dispatcher.d/00-netreport | 11 - adjtime | 2 - changes.ipv6 | 61 -- doc/changes.ipv6 | 61 ++ doc/examples/networking/ifcfg-bond-802.3ad | 16 + .../networking/ifcfg-bond-activebackup-arpmon | 17 + .../networking/ifcfg-bond-activebackup-miimon | 16 + doc/examples/networking/ifcfg-bond-slave | 12 + doc/examples/networking/ifcfg-bridge | 12 + doc/examples/networking/ifcfg-bridge-port | 9 + doc/examples/networking/ifcfg-eth-alias | 12 + doc/examples/networking/ifcfg-eth-dhcp | 14 + doc/examples/networking/ifcfg-vlan | 13 + doc/examples/static-routes-ipv6 | 21 + doc/ipv6-6to4.howto | 173 ++++ doc/ipv6-tunnel.howto | 100 ++ doc/sysconfig.txt | 1083 +++++++++++++++++++ doc/sysvinitfiles | 212 ++++ etc/NetworkManager/dispatcher.d/00-netreport | 11 + etc/adjtime | 2 + etc/networks | 3 + etc/profile.d/lang.csh | 83 ++ etc/profile.d/lang.sh | 90 ++ etc/rc.d/init.d/functions | 721 +++++++++++++ etc/rc.d/init.d/netconsole | 164 +++ etc/rc.d/init.d/network | 259 +++++ etc/rwtab | 45 + etc/statetab | 12 + etc/sysconfig/netconsole | 20 + etc/sysconfig/network-scripts | 1 + etc/sysconfig/readonly-root | 23 + examples/networking/ifcfg-bond-802.3ad | 16 - examples/networking/ifcfg-bond-activebackup-arpmon | 17 - examples/networking/ifcfg-bond-activebackup-miimon | 16 - examples/networking/ifcfg-bond-slave | 12 - examples/networking/ifcfg-bridge | 12 - examples/networking/ifcfg-bridge-port | 9 - examples/networking/ifcfg-eth-alias | 12 - examples/networking/ifcfg-eth-dhcp | 14 - examples/networking/ifcfg-vlan | 13 - initscripts.tmpfiles.d | 2 - ipv6-6to4.howto | 173 ---- ipv6-tunnel.howto | 100 -- lang.csh | 83 -- lang.sh | 90 -- man/consoletype.1 | 44 + man/genhostid.1 | 12 + man/ifup.8 | 36 + man/netreport.1 | 22 + man/service.8 | 91 ++ man/sushell.8 | 16 + man/sys-unconfig.8 | 29 + man/usernetctl.8 | 39 + man/usleep.1 | 30 + network-scripts/ifcfg-lo | 9 + network-scripts/ifdown | 71 ++ network-scripts/ifdown-bnep | 49 + network-scripts/ifdown-eth | 184 ++++ network-scripts/ifdown-ippp | 34 + network-scripts/ifdown-ipv6 | 139 +++ network-scripts/ifdown-post | 72 ++ network-scripts/ifdown-routes | 33 + network-scripts/ifdown-sit | 58 ++ network-scripts/ifdown-tunnel | 45 + network-scripts/ifup | 164 +++ network-scripts/ifup-aliases | 381 +++++++ network-scripts/ifup-bnep | 55 + network-scripts/ifup-ctc | 52 + network-scripts/ifup-eth | 372 +++++++ network-scripts/ifup-ippp | 384 +++++++ network-scripts/ifup-ipv6 | 316 ++++++ network-scripts/ifup-plip | 27 + network-scripts/ifup-plusb | 43 + network-scripts/ifup-post | 151 +++ network-scripts/ifup-routes | 76 ++ network-scripts/ifup-sit | 108 ++ network-scripts/ifup-tunnel | 94 ++ network-scripts/ifup-wireless | 62 ++ network-scripts/init.ipv6-global | 164 +++ network-scripts/network-functions | 744 ++++++++++++++ network-scripts/network-functions-ipv6 | 1084 ++++++++++++++++++++ networks | 3 - rc.d/init.d/functions | 721 ------------- rc.d/init.d/netconsole | 164 --- rc.d/init.d/network | 259 ----- rwtab | 45 - service | 91 -- service.8 | 91 -- src/consoletype.1 | 44 - src/genhostid.1 | 12 - src/ifup.8 | 36 - src/netreport.1 | 22 - src/sushell | 5 - src/sushell.8 | 16 - src/usernetctl.8 | 39 - src/usleep.1 | 30 - statetab | 12 - static-routes-ipv6 | 21 - sys-unconfig | 12 - sys-unconfig.8 | 29 - sysconfig.txt | 1083 ------------------- sysconfig/netconsole | 20 - sysconfig/network-scripts/ifcfg-lo | 9 - sysconfig/network-scripts/ifdown | 71 -- sysconfig/network-scripts/ifdown-bnep | 49 - sysconfig/network-scripts/ifdown-eth | 184 ---- sysconfig/network-scripts/ifdown-ippp | 34 - sysconfig/network-scripts/ifdown-ipv6 | 139 --- sysconfig/network-scripts/ifdown-post | 72 -- sysconfig/network-scripts/ifdown-routes | 33 - sysconfig/network-scripts/ifdown-sit | 58 -- sysconfig/network-scripts/ifdown-tunnel | 45 - sysconfig/network-scripts/ifup | 164 --- sysconfig/network-scripts/ifup-aliases | 381 ------- sysconfig/network-scripts/ifup-bnep | 55 - sysconfig/network-scripts/ifup-ctc | 52 - sysconfig/network-scripts/ifup-eth | 372 ------- sysconfig/network-scripts/ifup-ippp | 384 ------- sysconfig/network-scripts/ifup-ipv6 | 316 ------ sysconfig/network-scripts/ifup-plip | 27 - sysconfig/network-scripts/ifup-plusb | 43 - sysconfig/network-scripts/ifup-post | 151 --- sysconfig/network-scripts/ifup-routes | 76 -- sysconfig/network-scripts/ifup-sit | 108 -- sysconfig/network-scripts/ifup-tunnel | 94 -- sysconfig/network-scripts/ifup-wireless | 62 -- sysconfig/network-scripts/init.ipv6-global | 164 --- sysconfig/network-scripts/network-functions | 744 -------------- sysconfig/network-scripts/network-functions-ipv6 | 1084 -------------------- sysconfig/readonly-root | 23 - systemd/fedora-domainname | 9 - systemd/fedora-import-state | 39 - systemd/fedora-loadmodules | 11 - systemd/fedora-readonly | 204 ---- systemd/system/fedora-domainname.service | 13 - systemd/system/fedora-import-state.service | 17 - systemd/system/fedora-loadmodules.service | 16 - systemd/system/fedora-readonly.service | 15 - sysvinitfiles | 212 ---- udev/rules.d/60-net.rules | 1 - usr/lib/systemd/fedora-domainname | 9 + usr/lib/systemd/fedora-import-state | 39 + usr/lib/systemd/fedora-loadmodules | 11 + usr/lib/systemd/fedora-readonly | 204 ++++ usr/lib/systemd/system/fedora-domainname.service | 13 + usr/lib/systemd/system/fedora-import-state.service | 17 + usr/lib/systemd/system/fedora-loadmodules.service | 16 + usr/lib/systemd/system/fedora-readonly.service | 15 + usr/lib/tmpfiles.d/initscripts.conf | 2 + usr/lib/udev/rules.d/60-net.rules | 1 + usr/sbin/service | 91 ++ usr/sbin/sushell | 5 + usr/sbin/sys-unconfig | 12 + 153 files changed, 8930 insertions(+), 8929 deletions(-) delete mode 100755 NetworkManager/dispatcher.d/00-netreport delete mode 100644 adjtime delete mode 100644 changes.ipv6 create mode 100644 doc/changes.ipv6 create mode 100644 doc/examples/networking/ifcfg-bond-802.3ad create mode 100644 doc/examples/networking/ifcfg-bond-activebackup-arpmon create mode 100644 doc/examples/networking/ifcfg-bond-activebackup-miimon create mode 100644 doc/examples/networking/ifcfg-bond-slave create mode 100644 doc/examples/networking/ifcfg-bridge create mode 100644 doc/examples/networking/ifcfg-bridge-port create mode 100644 doc/examples/networking/ifcfg-eth-alias create mode 100644 doc/examples/networking/ifcfg-eth-dhcp create mode 100644 doc/examples/networking/ifcfg-vlan create mode 100644 doc/examples/static-routes-ipv6 create mode 100644 doc/ipv6-6to4.howto create mode 100644 doc/ipv6-tunnel.howto create mode 100644 doc/sysconfig.txt create mode 100644 doc/sysvinitfiles create mode 100755 etc/NetworkManager/dispatcher.d/00-netreport create mode 100644 etc/adjtime create mode 100644 etc/networks create mode 100644 etc/profile.d/lang.csh create mode 100644 etc/profile.d/lang.sh create mode 100644 etc/rc.d/init.d/functions create mode 100755 etc/rc.d/init.d/netconsole create mode 100755 etc/rc.d/init.d/network create mode 100644 etc/rwtab create mode 100644 etc/statetab create mode 100644 etc/sysconfig/netconsole create mode 120000 etc/sysconfig/network-scripts create mode 100644 etc/sysconfig/readonly-root delete mode 100644 examples/networking/ifcfg-bond-802.3ad delete mode 100644 examples/networking/ifcfg-bond-activebackup-arpmon delete mode 100644 examples/networking/ifcfg-bond-activebackup-miimon delete mode 100644 examples/networking/ifcfg-bond-slave delete mode 100644 examples/networking/ifcfg-bridge delete mode 100644 examples/networking/ifcfg-bridge-port delete mode 100644 examples/networking/ifcfg-eth-alias delete mode 100644 examples/networking/ifcfg-eth-dhcp delete mode 100644 examples/networking/ifcfg-vlan delete mode 100644 initscripts.tmpfiles.d delete mode 100644 ipv6-6to4.howto delete mode 100644 ipv6-tunnel.howto delete mode 100755 lang.csh delete mode 100755 lang.sh create mode 100644 man/consoletype.1 create mode 100644 man/genhostid.1 create mode 100644 man/ifup.8 create mode 100644 man/netreport.1 create mode 100644 man/service.8 create mode 100644 man/sushell.8 create mode 100644 man/sys-unconfig.8 create mode 100644 man/usernetctl.8 create mode 100644 man/usleep.1 create mode 100644 network-scripts/ifcfg-lo create mode 100755 network-scripts/ifdown create mode 100755 network-scripts/ifdown-bnep create mode 100755 network-scripts/ifdown-eth create mode 100755 network-scripts/ifdown-ippp create mode 100755 network-scripts/ifdown-ipv6 create mode 100755 network-scripts/ifdown-post create mode 100755 network-scripts/ifdown-routes create mode 100755 network-scripts/ifdown-sit create mode 100755 network-scripts/ifdown-tunnel create mode 100755 network-scripts/ifup create mode 100755 network-scripts/ifup-aliases create mode 100755 network-scripts/ifup-bnep create mode 100755 network-scripts/ifup-ctc create mode 100755 network-scripts/ifup-eth create mode 100755 network-scripts/ifup-ippp create mode 100755 network-scripts/ifup-ipv6 create mode 100755 network-scripts/ifup-plip create mode 100755 network-scripts/ifup-plusb create mode 100755 network-scripts/ifup-post create mode 100755 network-scripts/ifup-routes create mode 100755 network-scripts/ifup-sit create mode 100755 network-scripts/ifup-tunnel create mode 100755 network-scripts/ifup-wireless create mode 100755 network-scripts/init.ipv6-global create mode 100644 network-scripts/network-functions create mode 100644 network-scripts/network-functions-ipv6 delete mode 100644 networks delete mode 100644 rc.d/init.d/functions delete mode 100644 rc.d/init.d/netconsole delete mode 100755 rc.d/init.d/network delete mode 100644 rwtab delete mode 100755 service delete mode 100644 service.8 delete mode 100644 src/consoletype.1 delete mode 100644 src/genhostid.1 delete mode 100644 src/ifup.8 delete mode 100644 src/netreport.1 delete mode 100755 src/sushell delete mode 100644 src/sushell.8 delete mode 100644 src/usernetctl.8 delete mode 100644 src/usleep.1 delete mode 100644 statetab delete mode 100644 static-routes-ipv6 delete mode 100644 sys-unconfig delete mode 100644 sys-unconfig.8 delete mode 100644 sysconfig.txt delete mode 100644 sysconfig/netconsole delete mode 100644 sysconfig/network-scripts/ifcfg-lo delete mode 100755 sysconfig/network-scripts/ifdown delete mode 100755 sysconfig/network-scripts/ifdown-bnep delete mode 100755 sysconfig/network-scripts/ifdown-eth delete mode 100755 sysconfig/network-scripts/ifdown-ippp delete mode 100755 sysconfig/network-scripts/ifdown-ipv6 delete mode 100755 sysconfig/network-scripts/ifdown-post delete mode 100755 sysconfig/network-scripts/ifdown-routes delete mode 100755 sysconfig/network-scripts/ifdown-sit delete mode 100755 sysconfig/network-scripts/ifdown-tunnel delete mode 100755 sysconfig/network-scripts/ifup delete mode 100755 sysconfig/network-scripts/ifup-aliases delete mode 100755 sysconfig/network-scripts/ifup-bnep delete mode 100755 sysconfig/network-scripts/ifup-ctc delete mode 100755 sysconfig/network-scripts/ifup-eth delete mode 100755 sysconfig/network-scripts/ifup-ippp delete mode 100755 sysconfig/network-scripts/ifup-ipv6 delete mode 100755 sysconfig/network-scripts/ifup-plip delete mode 100755 sysconfig/network-scripts/ifup-plusb delete mode 100755 sysconfig/network-scripts/ifup-post delete mode 100755 sysconfig/network-scripts/ifup-routes delete mode 100755 sysconfig/network-scripts/ifup-sit delete mode 100755 sysconfig/network-scripts/ifup-tunnel delete mode 100755 sysconfig/network-scripts/ifup-wireless delete mode 100755 sysconfig/network-scripts/init.ipv6-global delete mode 100644 sysconfig/network-scripts/network-functions delete mode 100644 sysconfig/network-scripts/network-functions-ipv6 delete mode 100644 sysconfig/readonly-root delete mode 100755 systemd/fedora-domainname delete mode 100755 systemd/fedora-import-state delete mode 100755 systemd/fedora-loadmodules delete mode 100755 systemd/fedora-readonly delete mode 100644 systemd/system/fedora-domainname.service delete mode 100644 systemd/system/fedora-import-state.service delete mode 100644 systemd/system/fedora-loadmodules.service delete mode 100644 systemd/system/fedora-readonly.service delete mode 100644 sysvinitfiles delete mode 100644 udev/rules.d/60-net.rules create mode 100755 usr/lib/systemd/fedora-domainname create mode 100755 usr/lib/systemd/fedora-import-state create mode 100755 usr/lib/systemd/fedora-loadmodules create mode 100755 usr/lib/systemd/fedora-readonly create mode 100644 usr/lib/systemd/system/fedora-domainname.service create mode 100644 usr/lib/systemd/system/fedora-import-state.service create mode 100644 usr/lib/systemd/system/fedora-loadmodules.service create mode 100644 usr/lib/systemd/system/fedora-readonly.service create mode 100644 usr/lib/tmpfiles.d/initscripts.conf create mode 100644 usr/lib/udev/rules.d/60-net.rules create mode 100755 usr/sbin/service create mode 100755 usr/sbin/sushell create mode 100755 usr/sbin/sys-unconfig diff --git a/NetworkManager/dispatcher.d/00-netreport b/NetworkManager/dispatcher.d/00-netreport deleted file mode 100755 index eee7fb38..00000000 --- a/NetworkManager/dispatcher.d/00-netreport +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -cd /etc/sysconfig/network-scripts -. ./network-functions - -[ -f ../network ] && . ../network - -# Notify programs that have requested notification -do_netreport - -exit 0 diff --git a/adjtime b/adjtime deleted file mode 100644 index 3127bd0d..00000000 --- a/adjtime +++ /dev/null @@ -1,2 +0,0 @@ -0.0 0 0.0 -0 diff --git a/changes.ipv6 b/changes.ipv6 deleted file mode 100644 index 1970e98e..00000000 --- a/changes.ipv6 +++ /dev/null @@ -1,61 +0,0 @@ -v1.6 2nd Sep 2003, Pekka Savola - -IPv6 CHANGES -============ - -This mentions the most important changes (visible to the administrator) -in IPv6 initscripts. - -RHL9 -> CURRENT ---------------- - - - no major functional changes, only bugfixes and cleanups - -RHL80 -> RHL9 -------------- - - - 6to4 device MTU is calculated explicitly, IPV6TO4_MTU support added - - add route6- static route support - - secondary IPv6 addresses are configurable on tunnel interfaces too - -RHL73 -> RHL80 --------------- - - - no major functional changes - -RHL72 -> RHL73 --------------- - - - 6to4 device changed from sit0 to tun6to4 - - 6to4 assumes the anycast (closest) 6to4 server is used (192.88.99.1) - unless specified with IPV6TO4_RELAY. - - 6to4 does not support automatic tunneling *at all* anymore; use - IPV6_AUTOTUNNEL if you want to use it. - - All support from NBMA tunnels as well as 6to4 using sit0 was removed - - IPV6TO4_CONTROL_RADVD and IPV6TO4_RADVD_PIDFILE was changed to - IPV6_*, respectively. - - IPV6_DEFAULTGW and IPV6_DEFAULTDEV support was introduced; - /etc/sysconfig/static-routes-ipv6 must not be used for them anymore. - -Rough guide to migration: - - Rename IPV6TO4_CONTROL_RADVD to IPV6_CONTROL_RADVD if exists - - Rename IPV6TO4_RADVD_PIDFILE to IPV6_RADVD_PIDFILE if exists - - Remove "default" route from /etc/sysconfig/static-routes-ipv6 and replace - it with something like IPV6_DEFAULTDEV=tun6to4 in /etc/sysconfig/network - - If you need autotunneling, use IPV6_AUTOTUNNEL in /etc/sysconfig/network - -RHL71 -> RHL72 --------------- - - - 6to4 tunneling support was added using device sit0 - - Tunneling method was changed from NBMA (now obsolete) to dedicated - - Automatic tunneling configured was moved from ifcfg-sit0 to - IPV6_AUTOTUNNEL at /etc/sysconfig/network - - - -Some more information ---------------------- - -http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/scripts/current/ ,in particular: -http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/scripts/current/index.html#migration diff --git a/doc/changes.ipv6 b/doc/changes.ipv6 new file mode 100644 index 00000000..1970e98e --- /dev/null +++ b/doc/changes.ipv6 @@ -0,0 +1,61 @@ +v1.6 2nd Sep 2003, Pekka Savola + +IPv6 CHANGES +============ + +This mentions the most important changes (visible to the administrator) +in IPv6 initscripts. + +RHL9 -> CURRENT +--------------- + + - no major functional changes, only bugfixes and cleanups + +RHL80 -> RHL9 +------------- + + - 6to4 device MTU is calculated explicitly, IPV6TO4_MTU support added + - add route6- static route support + - secondary IPv6 addresses are configurable on tunnel interfaces too + +RHL73 -> RHL80 +-------------- + + - no major functional changes + +RHL72 -> RHL73 +-------------- + + - 6to4 device changed from sit0 to tun6to4 + - 6to4 assumes the anycast (closest) 6to4 server is used (192.88.99.1) + unless specified with IPV6TO4_RELAY. + - 6to4 does not support automatic tunneling *at all* anymore; use + IPV6_AUTOTUNNEL if you want to use it. + - All support from NBMA tunnels as well as 6to4 using sit0 was removed + - IPV6TO4_CONTROL_RADVD and IPV6TO4_RADVD_PIDFILE was changed to + IPV6_*, respectively. + - IPV6_DEFAULTGW and IPV6_DEFAULTDEV support was introduced; + /etc/sysconfig/static-routes-ipv6 must not be used for them anymore. + +Rough guide to migration: + - Rename IPV6TO4_CONTROL_RADVD to IPV6_CONTROL_RADVD if exists + - Rename IPV6TO4_RADVD_PIDFILE to IPV6_RADVD_PIDFILE if exists + - Remove "default" route from /etc/sysconfig/static-routes-ipv6 and replace + it with something like IPV6_DEFAULTDEV=tun6to4 in /etc/sysconfig/network + - If you need autotunneling, use IPV6_AUTOTUNNEL in /etc/sysconfig/network + +RHL71 -> RHL72 +-------------- + + - 6to4 tunneling support was added using device sit0 + - Tunneling method was changed from NBMA (now obsolete) to dedicated + - Automatic tunneling configured was moved from ifcfg-sit0 to + IPV6_AUTOTUNNEL at /etc/sysconfig/network + + + +Some more information +--------------------- + +http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/scripts/current/ ,in particular: +http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/scripts/current/index.html#migration diff --git a/doc/examples/networking/ifcfg-bond-802.3ad b/doc/examples/networking/ifcfg-bond-802.3ad new file mode 100644 index 00000000..973f181d --- /dev/null +++ b/doc/examples/networking/ifcfg-bond-802.3ad @@ -0,0 +1,16 @@ +# ifcfg sample for bond in mode 4/802.3ad +# with static networking configuration +# lacp_rate=1 for fast LACPDU rx rate (optional) +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=bond0 +ONBOOT=yes +USERCTL=no +TYPE=Ethernet +BOOTPROTO=none +BONDING_OPTS="mode=4 lacp_rate=1" +IPADDR=192.168.1.4 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/doc/examples/networking/ifcfg-bond-activebackup-arpmon b/doc/examples/networking/ifcfg-bond-activebackup-arpmon new file mode 100644 index 00000000..01acebac --- /dev/null +++ b/doc/examples/networking/ifcfg-bond-activebackup-arpmon @@ -0,0 +1,17 @@ +# ifcfg sample for bond in active-backup mode using +# ARP monitoring. The ARP probes frequency (arp_interval) +# is 500ms and the target IP address (arp_ip_target) +# is 192.168.1.1 +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=bond0 +ONBOOT=yes +USERCTL=no +TYPE=Ethernet +BOOTPROTO=none +BONDING_OPTS="mode=1 arp_interval=500 arp_ip_target=192.168.1.1" +IPADDR=192.168.1.4 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/doc/examples/networking/ifcfg-bond-activebackup-miimon b/doc/examples/networking/ifcfg-bond-activebackup-miimon new file mode 100644 index 00000000..befa2de3 --- /dev/null +++ b/doc/examples/networking/ifcfg-bond-activebackup-miimon @@ -0,0 +1,16 @@ +# ifcfg sample for bond in active-backup mode using +# MII link monitoring. The MII status polling frequency +# (miimon) is 500ms. +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=bond0 +ONBOOT=yes +USERCTL=no +TYPE=Ethernet +BOOTPROTO=none +BONDING_OPTS="mode=1 miimon=500" +IPADDR=192.168.1.4 +NETMASK=255.255.255.0 +GATEWAY=192.168.1.1 diff --git a/doc/examples/networking/ifcfg-bond-slave b/doc/examples/networking/ifcfg-bond-slave new file mode 100644 index 00000000..7ae54793 --- /dev/null +++ b/doc/examples/networking/ifcfg-bond-slave @@ -0,0 +1,12 @@ +# ifcfg sample for bond slave device +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=eth0 +TYPE=Ethernet +USERCTL=no +SLAVE=yes +MASTER=bond0 +BOOTPROTO=none +HWADDR=AA:BB:CC:DD:EE:FF diff --git a/doc/examples/networking/ifcfg-bridge b/doc/examples/networking/ifcfg-bridge new file mode 100644 index 00000000..346f6338 --- /dev/null +++ b/doc/examples/networking/ifcfg-bridge @@ -0,0 +1,12 @@ +# ifcfg sample for linux bridge device with IP address. +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=br0 +TYPE=Bridge +IPADDR=192.168.1.1 +NETMASK=255.255.255.0 +ONBOOT=yes +BOOTPROTO=none +DELAY=0 diff --git a/doc/examples/networking/ifcfg-bridge-port b/doc/examples/networking/ifcfg-bridge-port new file mode 100644 index 00000000..0de4778c --- /dev/null +++ b/doc/examples/networking/ifcfg-bridge-port @@ -0,0 +1,9 @@ +# ifcfg sample for a device that is a linux bridge port +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=eth1 +HWADDR=00:11:22:33:44:55 +ONBOOT=yes +BRIDGE=br0 diff --git a/doc/examples/networking/ifcfg-eth-alias b/doc/examples/networking/ifcfg-eth-alias new file mode 100644 index 00000000..60dc1d71 --- /dev/null +++ b/doc/examples/networking/ifcfg-eth-alias @@ -0,0 +1,12 @@ +# ifcfg sample for alias interface on top of eth0 +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=eth0:0 +BOOTPROTO=none +IPADDR=192.168.1.1 +NETMASK=255.255.255.0 +ONBOOT=yes +USERCTL=no + diff --git a/doc/examples/networking/ifcfg-eth-dhcp b/doc/examples/networking/ifcfg-eth-dhcp new file mode 100644 index 00000000..58d46bf8 --- /dev/null +++ b/doc/examples/networking/ifcfg-eth-dhcp @@ -0,0 +1,14 @@ +# ifcfg sample for common ethernet interfaces using DHCP +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +DEVICE=eth0 +BOOTPROTO=dhcp +HWADDR=00:11:22:33:44:55 +ONBOOT=yes + +# WARNING: When both DHCP_HOSTNAME and DHCP_FQDN are specified, +# only DHCP_FQDN will be used. +DHCP_HOSTNAME=host1 +DHCP_FQDN=host1.foo.bar.com diff --git a/doc/examples/networking/ifcfg-vlan b/doc/examples/networking/ifcfg-vlan new file mode 100644 index 00000000..d090aab0 --- /dev/null +++ b/doc/examples/networking/ifcfg-vlan @@ -0,0 +1,13 @@ +# ifcfg sample for a VLAN device (vlanid=122) on top of +# eth0 device using static IP configuration +# +# Please read /usr/share/doc/initscripts-*/sysconfig.txt +# for the documentation of these parameters. + +TYPE=Ethernet +DEVICE=eth0.122 +VLAN=yes +BOOTPROTO=none +NETMASK=255.255.255.0 +IPADDR=192.168.1.1 + diff --git a/doc/examples/static-routes-ipv6 b/doc/examples/static-routes-ipv6 new file mode 100644 index 00000000..a4c3b8d9 --- /dev/null +++ b/doc/examples/static-routes-ipv6 @@ -0,0 +1,21 @@ +# Version: 2002-01-09 + +# file: /etc/sysconfig/static-routes-ipv6 +# +# description: this file contains all static IPv6 routes +# description: Here you can specify several routes to specified gateways +# description: and also route through a virtual tunnel interface +# +# (P) 2000-2002 by Peter Bieringer + +#Device IPv6 network to route IPv6 gateway address + +## Example: static routes through a gateway on local link +#eth0 fec0:0:0:2::/64 fec0:0:0:1:0:0:0:20 +#eth0 3ffe:ffff:1234::/48 3ffe:ffff:1234:0002:0:0:0:1 + +## Example: default route through a gateway on local link +#eth0 2000::/3 3ffe:ffff:1234:0002:0:0:0:1 + +## Example: static route through a dedicated tunnel +#sit1 3ffe:ffff:1234::/48 diff --git a/doc/ipv6-6to4.howto b/doc/ipv6-6to4.howto new file mode 100644 index 00000000..131f4ce4 --- /dev/null +++ b/doc/ipv6-6to4.howto @@ -0,0 +1,173 @@ +v1.5 1st Sep 2003, Pekka Savola + +HOW TO SET UP IPV6 WITH 6TO4 +---------------------------- + +6TO4 IN SHORT +------------- + +6to4 is a method of creating automatic IPv6 tunnels. You can connect to +IPv6 Internet very easily without a need for a manually configured tunnel. + +For every globally unique IPv4 address, there exists a mapping for a +subnettable /48 network (2^16 for subnetting, 2^64 bits for hosts). + +Return route can sometimes be non-optimal, leading to higher round-trip times. + +See below for references and more information. + +ASSUMPTIONS +----------- + +1. You're running Red Hat Linux 7.1 or later. + + This is required for correct IPv6 by default settings, and IPv6 being + enabled as a kernel module by default. + +2. Your initscripts >= 6.02, for 6to4 support. + +3. You have a static, globally unique IPv4 address. This is not an absolute + requirement, but the only scenario discussed here. + +4. Protocol 41 (IPv6-in-IPv4) is not being filtered in any IPv4 firewall. + +5. 'iproute' package is installed. This is used by default for a lot + more powerful tunneling capabilities. + +Note: even though 6to4 was supported with earlier releases of Red Hat Linux, +below it is assumed that the initscripts package version this +document comes with is used. + +INFORMATION NEEDED +------------------ + +Nothing :-). + +If you want to select a specific relay (rather than automatically +selecting the closest one), you can define it with IPV6TO4_RELAY +using the list below: + +http://www.kfu.com/~nsayer/6to4/ + +SETTING UP THE 6TO4 CONFIGURATION +--------------------------------- + +Now, set up the configuration as follows: + +1. Enable IPv6 and set 6to4 pseudo-interface as default gateway in + /etc/sysconfig/network: + + echo "IPV6_DEFAULTDEV=tun6to4">> /etc/sysconfig/network + +2. Edit your outbound (Internet) interface configuration. This can be + e.g. ippp0, ppp0, eth0, or the like. Here, eth1 is used. + + +/etc/sysconfig/network-scripts/ifcfg-eth0: +--- +DEVICE=eth0 +BOOTPROTO=none +ONBOOT=yes +IPADDR=xx.yy.zz.ww [Globally unique IPv4 address] +NETMASK=aa.bb.cc.dd [IPv4 settings up to this point] + +IPV6INIT=yes +IPV6TO4INIT=yes +--- + + Note: [i]ppp - interfaces need to be called in /etc/ppp/ip-up|down.local; + if you are not using local files by yourself, this can easily be done with: + + cd /etc/ppp + ln -s ip-up.ipv6to4 ip-up.local + ln -s ip-down.ipv6to4 ip-down.local + + +USING 6TO4 +---------- + +6to4 automatic tunneling is brought up when the interface is brought up. + +You will see your 6to4 address prefix in device tun6to4 when done: + + inet6 addr: 2002:c15e:a001::1/16 Scope:Global + +Note that 'c15e:a001' is the hexadecimal representation of dotted-quad IPv4 +address (IPADDR= above), here '193.94.160.1'. + +NOTE: iproute tools give more reliable data, try e.g. '/sbin/ip addr ls'. + +PROVIDING IPV6 TO YOUR LAN +-------------------------- + +If you want to provide IPv6 for your LAN (e.g. connected on eth1) +using your Linux system as a router, this can be done rather easily with 6to4. + +You will need to enable IPv6 forwarding (IPV6FORWARDING=yes in +/etc/sysconfig/network) and install a router advertisement daemon. One such, +'radvd' is available in the distribution. + +You must configure the prefix your IPv4 maps to (see tun6to4 above) in +/etc/radvd.conf or use certain automatic hooks. This is not covered here +in detail; see radvd.conf(5) and /etc/sysconfig/network-scripts/ifup-ipv6 +for details. + +Usually the following is enough: + +1. Make sure that radvd package is installed. + +2. Configure radvd as outlined in radvd.conf(5); the file could + be something like: + + interface eth1 + { + AdvSendAdvert on; + MinRtrAdvInterval 3; + MaxRtrAdvInterval 10; + prefix 0:0:0:1::/64 + { + Base6to4Interface eth0; + AdvPreferredLifetime 120; + AdvValidLifetime 300; + }; + }; + +3. Make sure radvd starts at boot and start it now: + + /sbin/chkconfig radvd on + /sbin/service radvd start + +4. Make the initscripts signal radvd to recalculate the prefix when it + changes: + + /etc/sysconfig/network-scripts/ifcfg-eth0: + + IPV6_CONTROL_RADVD=yes + +5. Configure the associated routes to other 6to4 subnets to point at + your LAN interfaces; this can be done automatically with + IPV6TO4_ROUTING variable; please refer sysconfig.txt for details. + In the particular example, above, this would be like: + + /etc/sysconfig/network-scripts/ifcfg-eth0: + + IPV6TO4_ROUTING="eth1-:1::0/64" + + However, please note that no global address is configured on the + interface, just a route! + +MORE INFORMATION +---------------- + +http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/IPv6-HOWTO.html is a good +source of IPv6 related Linux-information. + +ftp://ftp.isi.edu/in-notes/rfc3056.txt ("Connection of IPv6 Domains via IPv4 +Clouds") is the RFC about 6to4. + +ftp://ftp.isi.edu/in-notes/rfc3068.txt ("An Anycast Prefix for 6to4 Relay +Routers") is the RFC about finding a close 6to4 relay automatically. + +http://www.ietf.org/internet-drafts/draft-savola-v6ops-6to4-security-02.txt +("Security Considerations and Enhancements for 6to4") explains some +security considerations in 6to4. diff --git a/doc/ipv6-tunnel.howto b/doc/ipv6-tunnel.howto new file mode 100644 index 00000000..ac5de0dc --- /dev/null +++ b/doc/ipv6-tunnel.howto @@ -0,0 +1,100 @@ +v1.4 10th Jan 2002, Pekka Savola + +HOW TO SET UP AN IPV6 TUNNEL +---------------------------- + +ASSUMPTIONS +----------- + +1. You're running Red Hat Linux 7.1 or later. + + This is required for correct IPv6 by default settings, and IPv6 being + enabled as a kernel module by default. You also need recent enough + initscripts, provided in RHL71. + +2. You have a static, globally unique IPv4 address. + +3. Protocol 41 (IPv6-in-IPv4) is not being filtered in any IPv4 firewall. + +4. 'iproute' package is installed. This is used by default for a lot + more powerful tunneling capabilities. + +INFORMATION NEEDED +------------------ + +You need to know: + +1. The IPv4 address of your tunnel end point +2. The IPv6 address used in your tunnel + +The other end needs to know the same things about your setup. + +NOTE: It is also possible to set up unnumbered tunnels (no global IPv6 +addresses). + +You must get these from a party (tunnel broker) who's assigning IPv6 tunnels. See: +http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/IPv6-HOWTO-1.html#joinIPv6backbone + +Example from http://old.freenet6.net: +--- +This script will create a tunnel between this computer +and the Freenet6 server (tunnels server) +Your IPv6 address (your tunnel end point) is +3ffe:b00:c18:1fff:0:0:0:7f5 +We establish a tunnel to the Freenet6 server at +3ffe:b00:c18:1fff:0:0:0:7f4 +Your IPv4 address is : 193.xxx.yyy.zzz +The IPv4 address of the Freenet6 server is : 206.123.31.102 +--- + +With this information, a tunnel can be set up: + +SETTING UP THE TUNNEL CONFIGURATION +----------------------------------- + +Now, set up the configuration as follows: + +1. Enable IPv6 and set tunnel as default gateway in /etc/sysconfig/network: + + echo "IPV6_DEFAULTDEV=sit1">> /etc/sysconfig/network + +2. Create /etc/sysconfig/network-scripts/ifcfg-sit1, with the following: + +--- +DEVICE=sit1 +BOOTPROTO=none +ONBOOT=yes +IPV6INIT=yes +IPV6TUNNELIPV4=206.123.31.102 +IPV6ADDR=3ffe:b00:c18:1fff:0:0:0:7f5/128 +--- + +NOTE: You must use _sit1_ (or sit2,...). sit0 cannot be used, this is a +special device. + +NOTE: Some tunnel endpoints might require a different kind of prefix length; +for example, Cisco's usually favour /126. Using /0 creates a default route +through that interface. + +NOTE: If you're not directly connected to the Internet, you may want to use +ONBOOT=no instead. + +TUNNELING +--------- + +Tunnel can be brought up and down with: + + ifup sit1 + ifdown sit1 + +NOTE: In initscripts < 6.02 (ie. IPV6_TUNNELMODE=NBMA), even though sit1 is used, +'ip' sees the tunnel as sit0. This is due to an "interesting" implementation +of tunneling -- else multiple tunnels couldn't be used extensibly. + +NOTE: iproute tools give more reliable data, try e.g. '/sbin/ip addr ls'. + +MORE INFORMATION +---------------- + +http://www.bieringer.de/linux/IPv6/IPv6-HOWTO/IPv6-HOWTO.html is a good +source of IPv6 related Linux-information. diff --git a/doc/sysconfig.txt b/doc/sysconfig.txt new file mode 100644 index 00000000..df4f789a --- /dev/null +++ b/doc/sysconfig.txt @@ -0,0 +1,1083 @@ + +======================= + +Generic options: + +/etc/sysconfig/* + + CGROUP_DAEMON= + List of control groups that the daemon will be run in. For example, + CGROUP_DAEMON="cpu:daemons cpuacct:/" will run it in the daemons + group for the CPU controller, and the '/' group for the CPU accounting + controller. + +/etc/sysconfig/authconfig + + used by authconfig to store information about the system's user + information and authentication setup; changes made to this file + have no effect until the next time authconfig is run + + USEHESIOD=no + Whether or not the hesiod naming service is in use. If not set, + authconfig examines the passwd setting in /etc/nsswitch.conf. + USELDAP=no + Whether or not LDAP is used as a naming service. If not set, + authconfig examines the passwd setting in /etc/nsswitch.conf. + USENIS=no + Whether or not NIS is in use. If not set, authconfig examines + the passwd setting in /etc/nsswitch.conf. + + USEKERBEROS=no + Whether or not Kerberos is in use. If not set, authconfig examines + the settings in /etc/pam.d/system-auth. + USELDAPAUTH=no + Whether or not LDAP is being used for authentication. If not set, + authconfig examines the settings in /etc/pam.d/system-auth. Note + that this option is separate from USELDAP, and that neither implies + the other. + USEMD5=no + Whether or not MD5-based hashing should be used when setting passwords. + If not set, authconfig examines the settings in /etc/pam.d/system-auth. + This option affects authentication using both local files and LDAP. + USESHADOW=no + Whether or not shadow passwords are in use. If not set, authconfig + checks for the existence of /etc/shadow. + USESMBAUTH=no + Whether or not SMB authentication is in use. If not set, authconfig + examines the settings in /etc/pam.d/system-auth. + +/etc/sysconfig/autofsck + + does not normally exist; if it does, it can influence a choice + whether or not to fsck after a crash + + AUTOFSCK_DEF_CHECK=no + If the user does not respond, choose whether or not to fsck + AUTOFSCK_SINGLEUSER= + If this is set, drop to single user mode before fsck. + +/etc/sysconfig/clock: + + Current releases use the third parameter in the /etc/adjtime + file (either 'UTC' or 'LOCAL') to determine whether the hwclock + is in UTC or localtime. + + ZONE="filename" indicates the zonefile under /usr/share/zoneinfo + that /etc/localtime is a copy of, for example: + ZONE="US/Eastern" + + deprecated values from earlier releases: + + CLOCKMODE=GMT indicates that the clock is set to UTC + CLOCKMODE=ARC on alpha only indicates the ARC console's + 42-year time offset is in effect + UTC=true,yes + Indicates that the hardware clock is set to UTC. + UTC=no,false + Indicates that the hardware clock is set to Local Time. + ARC=true on alpha only indicates the ARC console's + 42-year time offset is in effect; otherwise the normal + Unix epoch is assumed. + + SRM=true on alpha only indicates the SRM 1900 epoch is in + effect; otherwise the normal Unix epoch is assumed. + +/etc/sysconfig/init: + + BOOTUP= + BOOTUP=graphical means use X Windows graphical boot up + BOOTUP=color means colorized text mode boot display. + BOOTUP=verbose means old style display + Anything else means simplified display, but without color or ANSI-formatting + LOGLEVEL= + Sets the initial console logging level for the kernel. + The default is 7. 8 means everything (including debugging); + 1 means nothing except kernel panics. syslogd will override + this once it starts. + RES_COL= + Column of the screen to start status labels at. Defaults to 60 + MOVE_TO_COL= + A command to move the cursor to $RES_COL. Defaults to nasty + ANSI sequences output by echo -e. + SETCOLOR_SUCCESS= + A command to set the color to a color indicating success. + Defaults to nasty ANSI sequences output by echo -e setting + the color to green. + SETCOLOR_FAILURE= + A command to set the color to a color indicating failure. + Defaults to nasty ANSI sequences output by echo -e setting + the color to red. + SETCOLOR_WARNING= + A command to set the color to a color indicating warning. + Defaults to nasty ANSI sequences output by echo -e setting + the color to yellow. + SETCOLOR_NORMAL= + A command to set the color to 'normal'. Defaults to nasty + ANSI sequences output by echo -e. + PROMPT=yes|no + Set to 'yes' to enable the key check for interactive mode as well as + asking if a filesystem check should be done. Default is 'no' and + the kernel command line option "forcefsck" can be used to check the + filesystems and "confirm" can be used to enable interactive startup + questions. + + obsoleted values from earlier releases: + + MAGIC_SYSRQ=yes|no + Setting this to 'no' used to disable the magic sysrq key and + Stop-A (break on serial console) on SPARC. This setting has been + moved into kernel.sysrq and kernel.stop-a settings respectively in + sysctl.d/00-system.conf. Setting either of them there to 0 disables + it, setting it to 1 enables it. + STOP_A=yes|no + Setting this to 'no' used to disable the Stop-A (break on + serial console) key on SPARC. + This setting has been moved into kernel.stop-a setting in + sysctl.d/00-system.conf. Setting it there to 0 disables it, + setting it to 1 enables it. The setting should be present + on SPARC only. + +/etc/sysconfig/keyboard: + + KEYTABLE= + for example: KEYTABLE="/usr/lib/kbd/keytables/us.map" + + If you dump a keymap (using 'dumpkeys') to + /etc/sysconfig/console/default.kmap + it will be loaded on bootup before filesystems are mounted/checked. + This could be useful if you need to emergency type the root password. + This has to be a dumped keymap, as opposed to copying the shipped + keymap files, as the shipped files include other maps from the + /usr/lib/kbd/keytables directory. + + KEYBOARDTYPE=sun|pc + on SPARC only, sun means a sun keyboard is attached on /dev/kbd, + pc means a PS/2 keyboard is on ps/2 port. + +/etc/sysconfig/mouse: + + MOUSETYPE=microsoft|mouseman|mousesystems|ps/2|msbm|logibm|atibm| + logitech|mmseries|mmhittab + XEMU3=yes|no (emulate three buttons with two buttons whenever + necessary, most notably in X) + DEVICE= (the device of the mouse) + + In addition, /dev/mouse points to the mouse device. + +/etc/sysconfig/network: + + NETWORKING=yes|no + GATEWAY= + GATEWAYDEV= (e.g. eth0) + NISDOMAIN= + NOZEROCONF= + Set this to not set a route for dynamic link-local addresses. + + NETWORKDELAY= + Delay in seconds after all network interfaces are initialized. Useful if + network has spanning tree running and must wait for STP convergence. + Default: 0 (no delay) + + IFDOWN_ON_SHUTDOWN=yes|no + If yes, do bring interfaces down during system shutdown. If no, leave them + in their current state (this is only supported on hosts using systemd). + Default: yes (bring interfaces down) + + + IPV6FORWARDING=yes|no + Enable or disable global forwarding of incoming IPv6 packets + on all interfaces. + Note: Actual packet forwarding cannot be controlled per-device, use netfilter6 for such issues + Default: no + + IPV6_AUTOCONF=yes|no + Sets the default for device-based autoconfiguration. + Default: yes if IPV6FORWARDING=no, no if IPV6FORWARDING=yes + IPV6_ROUTER=yes|no + Sets the default for device-based Host/Router behaviour. + Default: yes if IPV6FORWARDING=yes, no if IPV6FORWARDING=no + IPV6_AUTOTUNNEL=yes|no + Controls automatic IPv6 tunneling. + Default: no + + IPV6_DEFAULTGW= (optional) + Add a default route through specified gateway + An interface can be specified: required for link-local addresses + Examples: + IPV6_DEFAULTGW="3ffe:ffff:1234:5678::1" + Add default route through 3ffe:ffff:1234:5678::1 + IPV6_DEFAULTGW="3ffe:ffff:1234:5678::1%eth0" + Add default route through 3ffe:ffff:1234:5678::1 and device eth0 + IPV6_DEFAULTGW="fe80::1%eth0" + Add default route through fe80::1 and device eth0 + + Note: if IPV6_DEFAULTGW is specified with %interface scope and it + doesn't match IPV6_DEFAULTDEV, IPV6_DEFAULTDEV is ignored. + Note: it's preferred to use %interface for all addresses, not + just link-local if you have multiple IPv6-enabled interfaces. + + IPV6_DEFAULTDEV= (optional) + Add a default route through specified interface without specifying next hop + Type of interface will be tested whether this is allowed + Examples: + IPV6_DEFAULTDEV="eth0" INVALID example! + IPV6_DEFAULTDEV="ppp0" + IPV6_DEFAULTDEV="sit1" + Examples for 6to4 + IPV6_DEFAULTDEV="tun6to4" + Add default route through dedicated 6to4 tunnel device "tun6to4", if configured + + Note: "tun6to4" does not support an additional IPV6_DEFAULTGW. + Other interfaces prefer IPV6_DEFAULTGW, if specified. + + IPV6_RADVD_PIDFILE= (optional) + Location of PID file for controlling radvd, see IPV6_CONTROL_RADVD + Default: "/run/radvd/radvd.pid" + Example: + IPV6_RADVD_PIDFILE="/some/other/location/radvd.pid" + IPV6TO4_RADVD_PIDFILE= (obsolete) + As above, still supported for a while for backward compatibility. + IPV6_RADVD_TRIGGER_ACTION=startstop|reload|restart|SIGHUP (optional) + How to trigger radvd in case of 6to4 or PPP action + startstop: radvd starts if interface goes up and stops + if interface goes down using initscript call of radvd with related parameter + reload|restart: initscript of radvd is called with this parameter + SIGHUP: signal HUP is sent to radvd, pidfile must be specified, if not the default + Default: SIGHUP + + IPv6 options above can be overridden in interface-specific configuration. + + obsoleted values from earlier releases: + + FORWARD_IPV4=yes|no + Create a new file in /etc/sysctl.d/ with the net.ipv4.ip_forward + setting instead. Setting it to 1 there enables IP forwarding, + setting it to 0 disables it (which is the default for RFC compliance). + + NETWORKWAIT=yes|no + This is not used with the move to systemd. + + HOSTNAME= + This is now configured in /etc/hostname. + +/etc/sysconfig/static-routes-ipv6: + Contains lines of the form: + + IPv6-network IPv6-gateway + IPv6-network + + must be a device name to have the route brought up and + down with the device + + For example: + + eth0 fec0:0:0:2::/64 fec0:0:0:1:0:0:0:20 + adds a route for IPv6 network fec0:0:0:2::/64 through fec0:0:0:1:0:0:0:20 + + eth0 2000::/3 3ffe:ffff:0:1::1 + so-called "default" routes for clients + + sit1 2000::/3 + adds routes through dedicated tunnel interface sit1 + + tun6to4 3ffe:ffff:1234::/56 + adds routes through hardwired 6to4 tunnel interface tun6to4 + tun6to4 3ffe:ffff:5678::/56 ::5.6.7.8 + adds routes through hardwired 6to4 tunnel interface tun6to4, + specifying next hop + + Notes: + * default routes (such as the "2000::/3" shown above) should be set with + IPV6_DEFAULTGW and IPV6_DEFAULTDEV, see more above. + * tunnel device "sit0" is not supported here, routes will never be applied + +/etc/sysconfig/routed: + + SILENT=yes|no + EXPORT_GATEWAY=yes|no + +/etc/sysconfig/rawdevices: + + This is used for setting up raw device to block device mappings. + It has the format: + + + For example: + /dev/raw/raw1 /dev/sda1 + /dev/raw/raw2 8 5 + +/etc/sysconfig/pcmcia: + + PCMCIA=yes|no + PCIC=i82365|tcic + PCIC_OPTS= + CORE_OPTS= + CARDMGR_OPTS= + +/etc/sysconfig/amd: + + ADIR=/.automount (normally never changed) + MOUNTPTS='/net /etc/amd.conf' (standard automount stuff) + AMDOPTS= (extra options for AMD) + +/etc/sysconfig/tape: + + DEV=/dev/nst0 + Tape device. Use the non-rewinding one for these scripts. + + For SCSI tapes this is /dev/nst#, where # is the number of the + tape drive you want to use. If you only have one then use + nst0. + + For IDE tapes you use /dev/ht#, where # is the number of the tape + drive you want to use (usually ht0). + + For floppy tape drives use /dev/ftape. + + ADMIN=root + Person to mail to if the backup fails for any reason + + SLEEP=5 + Time to sleep between tape operations. Some drives need a bit + more than others, but 5 seems to work for 8mm, 4mm, and DLT + + BLOCKSIZE=32768 + This worked fine for 8mm, then 4mm, and now DLT. An optimal + setting is probably however much data your drive writes at one + time. + + SHORTDATE=$(date +%y:%m:%d:%H:%M) + A short date string, used in backup log filenames. + + DAY=$(date +log-%y:%m:%d) + This is used for the log file directory. + + DATE=$(date) + Regular date string, used in log files. + + LOGROOT=/var/log/backup + Root of the logging directory + + LIST=$LOGROOT/incremental-list + This is the file name the incremental backup will use to store + the incremental list. It will be $LIST-{some number}. + + DOTCOUNT=$LOGROOT/.count + For counting as you go to know which incremental list to use + + COUNTER=$LOGROOT/counter-file + For rewinding when done...might not use. + + BACKUPTAB=/etc/backuptab + The file in which we keep our list of backup(s) we want to make. + +/etc/sysconfig/saslauthd: + + used by the saslauthd init script (part of the cyrus-sasl package) to + control which arguments are passed to saslauthd at startup time; changes + made to this file have no effect until saslauthd is restarted + + MECH=shadow + controls which data source saslauthd will consult when checking user + passwords; run 'saslauthd -v' to get a full list of available + authentication mechanisms + SOCKETDIR=/run/saslauthd + controls in which directory saslauthd will be directed to create its + listening socket; any change to this value will require a corresponding + change in client configuration files + +/etc/sysconfig/sendmail: + DAEMON=yes|no + yes implies -bd (i.e., listen on port 25 for new mail) + 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. + +/etc/locale.conf + + A configutration file for locale settings. See locale.conf(5) for + more details. + + LANG= set locale for all categories, can be any two letter ISO + language code + LC_CTYPE= locale data configuration for classification and conversion + of characters + LC_COLLATE= locale data configuration for collation (sort order) of + strings + LC_MESSAGES= locale data configuration for translation of messages + LC_NUMERIC= locale data configuration for non-monetary numeric data + LC_MONETARY= locale data configuration for monetary data + LC_TIME= locale data configuration for date and time + LC_ALL= locale data configuration overriding all of the above + LANGUAGE= can be a : separated list of ISO language codes + LINGUAS= can be a ' ' separated list of ISO language codes + + The above variables are used in /etc/profile.d/lang.sh. + + If ~/.i18n exists, it is used in addition to /etc/locale.conf and + for per-user customization of the locales. + +/etc/vconsole.conf: + + SYSFONT= Console font. Fonts are found in /lib/kbd/consolefonts. + + UNIMAP= Unicode font map. Most fonts have these built-in. Font maps + can be found in /lib/kbd/unimaps. These are applied via setfont's + -u option. + + SYSFONTACM= Console map. These are applied via setfont's -m option, + and are found in /lib/kbd/consoletrans. + + The above are used to set up the keyboard at boot time. For more + information, see vconsole.conf(5). + +Files in /etc/sysconfig/network-scripts/ +======================================== + +/etc/sysconfig/network-scripts/ifup: +/etc/sysconfig/network-scripts/ifdown: + + Symlinks to /sbin/ifup and /sbin/ifdown, respectively. + These are the only two scripts "in" this directory that should + be called directly; these two scripts call all the other + scripts as needed. These symlinks are here for legacy purposes -- + only /sbin/ifup and /sbin/ifdown should currently be used + at the user level. + + These scripts take one argument normally: the name of the device + (e.g. eth0). They are called with a second argument of "boot" + during the boot sequence so that devices that are not meant to + be brought up on boot (ONBOOT=no, see below) can be ignored at + that time. + + Also, interfaces may be brought up via the hotplug scripts; + in this case, HOTPLUG=no needs to be set to no to avoid this. + This is useful e.g. to prevent bonding device activation by merely + loading the bonding kernel module. + +/etc/sysconfig/network-scripts/init.ipv6-global: + Not really a public file. Contains different basic settings that + are set from /etc/[rc.d]/init.d/network at different stages of + network initialization. + +/etc/sysconfig/network-scripts/network-functions: + + Not really a public file. Contains functions which the scripts use + for bringing interfaces up and down. In particular, it contains + most of the code for handling alternative interface configurations + and interface change notification through netreport. + +/etc/sysconfig/network-scripts/network-functions-ipv6: + + Not really a public file. Contains functions which the scripts use + for bringing IPv6 on interfaces up and down, like addresses, routes, + forwarding handling and static or automatic tunneling. + +/etc/sysconfig/network-scripts/ifcfg- and +/etc/sysconfig/network-scripts/ifcfg-:: + + The first defines an interface, and the second contains + only the parts of the definition that are different in a + "alias" (or alternative) interface. For example, the + network numbers might be different, but everything else + might be the same, so only the network numbers would be + in the alias file, but all the device information would + be in the base ifcfg file. + + The items that can be defined in an ifcfg file depend on the + interface type. The really obvious ones I'm not going to + bother to define; you can figure out what "IPADDR" is, I + think... :-) + + Base items: + NAME= + Most important for PPP. Only used in front ends. + DEVICE= + IPADDRn= + PREFIXn= + Network prefix. It is used for all configurations except aliases + and ippp devices. It takes precedence over NETMASK when both + PREFIX and NETMASK are set. + NETMASKn= + Subnet mask; just useful for aliases and ippp devices. For all other + configurations, use PREFIX instead. + + The "n" is expected to be consecutive positive integers starting from 0. + It can be omitted if there is only one address being configured. + + GATEWAY= + METRIC= + Metric for the default route using GATEWAY + ONBOOT=yes|no (not valid for alias devices; use ONPARENT) + HOTPLUG=yes|no + USERCTL=yes|no + BOOTPROTO=none|bootp|dhcp + 'bootp' or 'dhcp' cause a DHCP client to run on the device. Any other + value causes any static configuration in the file to be applied. + VLAN=yes|no + MTU= + Default MTU for this device + WINDOW= + Default window for routes from this device + PEERDNS=yes|no + modify /etc/resolv.conf if peer uses msdns extension (PPP only) or + DNS{1,2} are set, or if using dhclient. default to "yes". + DNS{1,2}= + provide DNS addresses that are dropped into the resolv.conf + file if PEERDNS is not set to "no". + SCOPE= + Set to "scope SCOPE-ID" to set a non-default scope for a statically + configured IP address. + SRCADDR= + use the specified source address for outgoing packets + HWADDR= + ethernet hardware address for this device + MACADDR= + Set the hardware address for this device to this. + Use of this in conjunction with HWADDR= may cause + unintended behavior. + NOZEROCONF= + Set this to not set a route for dynamic link-local addresses + over this device. + PERSISTENT_DHCLIENT=yes|no|1|0 + Without this option, or if it is 'no'/'0', and BOOTPROTO=dhcp, + dhclient is run for the interface in "one-shot" mode; if the + dhcp server does not respond for a configurable timeout, then + dhclient exits and the interface is not brought up - + the '-1' option is given to dhclient. + If PERSISTENT_DHCLIENT=yes, then dhclient will keep on trying + to contact the dhcp server when it does not respond - no '-1' + option is given to dhclient. Note: this disables the automatic + checking for the presence of a link before starting dhclient. + DHCPRELEASE=yes|no|1|0 + With this option set to 'yes' (1), when a dhcp configured + interface is brought down with 'ifdown', the lease will be + released. Otherwise, leases are not released. + + NO_DHCP_HOSTNAME=yes|no|1|0 + Tells initscripts to not obtain hostname from DHCP server in the ifup-post + phase. This option might be useful especially with static configuration of + the interface. + DHCP_SEND_HOSTNAME=yes|no|1|0 + Tells initscripts whether the DHCP_HOSTNAME or DHCP_FQDN options (below) + should be sent to DHCP server. + DHCP_HOSTNAME= + Sends the specified hostname to the DHCP server. + DHCP_FQDN= + Sends the specified FQDN to the DHCP server. + + Please note when both DHCP_HOSTNAME and DHCP_FQDN are specified, + only DHCP_FQDN will be used. (Same behaviour as with NetworkManager.) + + DHCLIENT_IGNORE_GATEWAY=yes|no|1|0 + If set to 'yes', it will cause dhclient-script to ignore any $GATEWAY + setting that may be in the ifcfg file for this interface. + Otherwise, the dhclient session which obtains an ip-address + on the same subnet as $GATEWAY will set the default route + to be via $GATEWAY, and no other dhclient session will set + the default route. + DHCLIENTARGS= + Any additional arguments to dhclient. + NM_CONTROLLED=yes|no + If set to 'no', NetworkManager will ignore this connection/device. + Defaults to 'yes'. + ZONE= + Network zone (trust level) of this connection. + If not set, default zone (specified in /etc/firewalld/firewalld.conf) + is used. To see all available zones, run 'firewall-cmd --get-zones'. + ARPCHECKn=yes|no + If set to 'no', ifup will not try to determine, if requested ip address + is used by other machine in network. + Defaults to 'yes'. + ARPUPDATE=yes|no + If set to 'no' the neighbours in current network will not be updated with + ARP information about this NIC. This is especially handy using LVS Load + Balancing with Direct Routing enabled. + Defaults to 'yes'. + IPV4_FAILURE_FATAL=yes|no + If set to yes, ifup-eth will end immediately after ipv4 dhclient fails. + Defaults to 'no'. + + For dynamic addressing (BOOTPROTO=dhcp) only DEVICE needs to + be set; all the rest will be determined by the boot protocol. + + IPV6_SET_SYSCTLS=yes|no + If set, network-scripts will attempt to set sysctls based on the setup + of the interface. For example, will try to set `accept_ra` for interfaces + where $IPV6_AUTOCONF is set to `yes`. Defaults to `yes`, set to `no` if you + want to manage these yourself. + + Base items being deprecated: + NETWORK= + BROADCAST= + + Alias specific items: + ONPARENT=yes|no + Whether to bring up the device when the parent device is brought + up. + Default: yes + + IPv6-only items for real interfaces: + IPV6INIT=yes|no + Enable or disable IPv6 static, DHCP, or autoconf configuration for this interface + Default: yes + IPV6FORWARDING=yes|no + Enable or disable global forwarding of incoming IPv6 packets + Note: Obsolete in interface specification! + Default: no + IPV6ADDR=[/] + Specify a primary static IPv6 address here + Optional, if normal host and a router advertisement daemon is on local link + Required, if node is a router and interface should route packets + Note: if prefix length is omitted, 64 is assumed + Example: + IPV6ADDR="3ffe:ffff:0:5::1" + IPV6ADDR="3ffe:ffff:0:1::1/128" + IPV6ADDR_SECONDARIES="[/] ..." (optional) + A list of secondary IPv6 addresses (e.g. useful for virtual hosting) + Example: + IPV6ADDR_SECONDARIES="3ffe:ffff:0:1::10 3ffe:ffff:0:2::11/128" + IPV6_MTU= (optional) + Optional, dedicated MTU of this link + Note: Must be greater or equal to 1280. + Example: + IPV6_MTU="1280" + IPV6_PRIVACY=rfc3041 + Enables RFC 3041 IPv6 privacy support if set. + Default: RFC 3041 support disabled + IPV6_FORCE_ACCEPT_RA=yes|no + By default network-scripts will set `accept_ra` only if $IPV6_AUTOCONF is + set to `yes`. If you don't want SLAAC addresses but do want to accept RA, + then set this to `yes`. Defaults to `no`. + + Special configuration options for multi-homed hosts etc. + IPV6_ROUTER=yes|no: Controls IPv6 autoconfiguration + IPV6_AUTOCONF=yes|no: Controls IPv6 autoconfiguration + Defaults: + Global IPV6FORWARDING=yes: IPV6_AUTOCONF=no, IPV6_ROUTER=yes + Global IPV6FORWARDING=no: IPV6_AUTOCONF=yes + + Optional settings for a 6to4 tunnel + IPV6TO4INIT=yes|no + Enable or disable 6to4 tunneling setup + Default: no + IPV6TO4_RELAY= (optional) + IPv4 address of the remote 6to4 relay + Note: if this is omitted, ::192.88.99.1 (the anycast relay address) is chosen + IPV6TO4_IPV4ADDR=[/] (optional) + Overwrite local IPv4 address which is accessible from the Internet + (optional, in case of static IPv4-NAT behind a router or other special scenarios) + IPV6TO4_MTU= (optional) + Controls IPv6 MTU for the 6to4 tunnel + Note: Must be greater or equal to 1280 + Example: + IPV6TO4_MTU="1280" + Default: MTU of master device - 20 + IPV6TO4_ROUTING="-/ ..." (optional) + A list of routing tokens to setup proper IPv6 interfaces on the LAN + Example: + IPV6TO4_ROUTING="eth0-:0004::1/64 eth1-:0005::1/64" + Will create one address per eth0 and eth1, taking given SLA + + Optional settings for a 6to4 tunnel or a ppp link + IPV6_CONTROL_RADVD=yes|no (optional) + Enable signaling radvd that the 6to4 prefix has been changed or a + preconfigured dynamic device is up or down + Default: no + + IPv6-only items for static tunnel interface: + Interface name: sitX (X => 1) + IPV6INIT=yes|no + Enable or disable IPv6 configuration for this interface + Default: no + IPV6TUNNELIPV4= + Specify IPv4 address of a foreign IPv6-in-IPv4 tunnel endpoint + Example: + IPV6TUNNELIPV4="1.2.3.4" + IPV6TUNNELIPV4LOCAL= + Specify local IPv4 address of tunnel, useful on interfaces with multiple IPv4 addresses + IPV6ADDR=[/] (optional) + local IPv6 address of a numbered tunnel + IPV6ADDR_SECONDARIES="[/] ..." (optional) + A list of secondary IPv6 addresses (example see above) + IPV6_MTU= (optional) + Optional, dedicated MTU of this tunnel + Note: Must be greater or equal to 1280 + Example: + IPV6_MTU="1280" + + IPv6-only option to enable DHCPv6 client: + DHCPV6C=yes|no + This will enable the DHCPv6 features of dhclient to be run for the interface. + See man dhclient(8) and dhclient.conf(5). + DHCPV6C_OPTIONS=... + This will pass given arguments to the DHCPv6 client. For example, + "-S" option will request network information (e.g., DNS addresses) + only, not IPv6 addresses. + + Ethernet-only items: + ARP=yes|no (adds 'arp' flag to ip, for use with the + ethertap device) + LINKDELAY=
: controls default route (optional) +# +# Uses following information from "/etc/sysconfig/network-scripts/ifcfg-$1": +# IPV6INIT=yes|no: controls IPv6 configuration for this interface +# IPV6ADDR=[/]: specify primary static IPv6 address +# IPV6ADDR_SECONDARIES="[/] ..." (optional) +# IPV6_ROUTER=yes|no: controls IPv6 autoconfiguration (no: multi-homed interface without routing) +# IPV6_AUTOCONF=yes|no: controls IPv6 autoconfiguration +# defaults: +# IPV6FORWARDING=yes: IPV6_AUTOCONF=no, IPV6_ROUTER=yes +# IPV6FORWARDING=no: IPV6_AUTOCONF=yes +# IPV6_MTU=: controls IPv6 MTU for this link (optional) +# IPV6_PRIVACY="rfc3041": control IPv6 privacy (optional) +# This script only supports "rfc3041" (if kernel supports it) +# +# Optional for 6to4 tunneling (hardwired name of tunnel device is "tun6to4"): +# IPV6TO4INIT=yes|no: controls 6to4 tunneling setup +# IPV6TO4_RELAY=: IPv4 address of the remote 6to4 relay (default: 192.88.99.1) +# IPV6TO4_MTU=: controls IPv6 MTU for the 6to4 link (optional, default is MTU of interface - 20) +# IPV6TO4_IPV4ADDR=: overwrite local IPv4 address (optional) +# IPV6TO4_ROUTING="-/ ...": information to setup additional interfaces +# Example: IPV6TO4_ROUTING="eth0-:f101::1/64 eth1-:f102::1/64" +# +# Optional for 6to4 tunneling to trigger radvd: +# IPV6_CONTROL_RADVD=yes|no: controls radvd triggering (optional) +# IPV6_RADVD_PIDFILE=: PID file of radvd for sending signals, default is "/run/radvd/radvd.pid" (optional) +# IPV6_RADVD_TRIGGER_ACTION=startstop|reload|restart|SIGHUP: how to trigger radvd (optional, default is SIGHUP) +# +# Required version of radvd to use 6to4 prefix recalculation +# 0.6.2p3 or newer supporting option "Base6to4Interface" +# Required version of radvd to use dynamic ppp links +# 0.7.0 + fixes or newer +# + + +. /etc/sysconfig/network + +cd /etc/sysconfig/network-scripts +. ./network-functions + +CONFIG=$1 +[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG +source_config + +REALDEVICE=${DEVICE%%:*} +DEVICE=$REALDEVICE + +# Test whether IPv6 configuration is disabled for this interface +is_false "$IPV6INIT" && exit 0 + +[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1 +. /etc/sysconfig/network-scripts/network-functions-ipv6 + + +# IPv6 test, module loaded, exit if system is not IPv6-ready +ipv6_test || exit 1 + +# Test device status +ipv6_test_device_status $DEVICE +if [ $? != 0 -a $? != 11 ]; then + # device doesn't exist or other problem occurs + exit 1 +fi + +# Setup IPv6 address on specified interface +if [ -n "$IPV6ADDR" ]; then + ipv6_add_addr_on_device $DEVICE $IPV6ADDR || exit 1 +fi + +# Get current global IPv6 forwarding +ipv6_global_forwarding_current="$(/sbin/sysctl -e -n net.ipv6.conf.all.forwarding)" + +# Set some proc switches depending on defines +if [ "$IPV6FORWARDING" = "yes" ]; then + # Global forwarding should be enabled + + # Check, if global IPv6 forwarding was already set by global script + if [ $ipv6_global_forwarding_current -ne 1 ]; then + net_log $"Global IPv6 forwarding is enabled in configuration, but not currently enabled in kernel" + net_log $"Please restart network with '/sbin/service network restart'" + fi + + ipv6_local_forwarding=1 + ipv6_local_auto=0 + ipv6_local_accept_ra=0 + if [ "$IPV6_ROUTER" = "no" ]; then + ipv6_local_forwarding=0 + fi + if [ "$IPV6_AUTOCONF" = "yes" ]; then + ipv6_local_auto=1 + ipv6_local_accept_ra=2 + fi +else + # Global forwarding should be disabled + + # Check, if global IPv6 forwarding was already set by global script + if [ $ipv6_global_forwarding_current -ne 0 ]; then + net_log $"Global IPv6 forwarding is disabled in configuration, but not currently disabled in kernel" + net_log $"Please restart network with '/sbin/service network restart'" + fi + + ipv6_local_forwarding=0 + ipv6_local_auto=1 + ipv6_local_accept_ra=1 + if [ "$IPV6_AUTOCONF" = "no" ]; then + ipv6_local_auto=0 + if [ ! "$IPV6_FORCE_ACCEPT_RA" = "yes" ]; then + ipv6_local_accept_ra=0 + fi + fi +fi + +if [ ! "$IPV6_SET_SYSCTLS" = "no" ]; then + /sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.forwarding=$ipv6_local_forwarding >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.accept_ra=$ipv6_local_accept_ra >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.accept_redirects=$ipv6_local_auto >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.autoconf=$ipv6_local_auto >/dev/null 2>&1 +fi + +# Set IPv6 MTU, if given +if [ -n "$IPV6_MTU" ]; then + ipv6_set_mtu $DEVICE $IPV6_MTU +fi + +# Setup additional IPv6 addresses from list, if given +if [ -n "$IPV6ADDR_SECONDARIES" ]; then + for ipv6addr in $IPV6ADDR_SECONDARIES; do + ipv6_add_addr_on_device $DEVICE $ipv6addr + done +fi + +# Enable IPv6 RFC3041 privacy extensions if desired +if [ "$IPV6_PRIVACY" = "rfc3041" ]; then + if [ ! "$IPV6_SET_SYSCTLS" = "no" ]; then + /sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.use_tempaddr=2 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + net_log $"Cannot enable IPv6 privacy method '$IPV6_PRIVACY', not supported by kernel" + fi + fi +fi + +# Setup default IPv6 route, check are done by function +if [ -n "$IPV6_DEFAULTDEV" -o -n "$IPV6_DEFAULTGW" ]; then + ipv6_set_default_route "$IPV6_DEFAULTGW" "$IPV6_DEFAULTDEV" "$DEVICE" +fi + +# Setup additional static IPv6 routes on specified interface, if given +if [ -f /etc/sysconfig/static-routes-ipv6 ]; then + LC_ALL=C grep -w "^$DEVICE" /etc/sysconfig/static-routes-ipv6 | while read device args; do + ipv6_add_route $args $DEVICE + done +fi + +# Setup of 6to4, if configured +if [ "$IPV6TO4INIT" = "yes" ]; then + valid6to4config="yes" + + # Test device status of 6to4 tunnel + ipv6_test_device_status tun6to4 + if [ $? = 0 ]; then + # device is already up + net_log $"Device 'tun6to4' (from '$DEVICE') is already up, shutdown first" + exit 1 + fi + + # Get IPv4 address for global 6to4 prefix calculation + if [ -n "$IPV6TO4_IPV4ADDR" ]; then + # Take special configured from config file (precedence 1) + ipv4addr="$IPV6TO4_IPV4ADDR" + + # Get local IPv4 address from interface + ipv4addrlocal="$(ipv6_get_ipv4addr_of_device $DEVICE)" + if [ -z "$ipv4addrlocal" ]; then + # Take configured from config file + ipv4addrlocal="$IPADDR" + fi + else + # Get IPv4 address from interface first (has precedence 2) + ipv4addr="$(ipv6_get_ipv4addr_of_device $DEVICE)" + if [ -z "$ipv4addr" ]; then + # Take configured from config file (precedence 3) + ipv4addr="$IPADDR" + fi + ipv4addrlocal="$ipv4addr" + fi + + if [ -n "$ipv4addr" ]; then + if ! ipv6_test_ipv4_addr_global_usable $ipv4addr; then + net_log $"Given IPv4 address '$ipv4addr' is not globally usable" info + valid6to4config="no" + fi + if [ -z "$IPV6TO4_RELAY" ]; then + IPV6TO4_RELAY="192.88.99.1" + fi + + # Check/generate relay address + ipv6to4_relay="$(ipv6_create_6to4_relay_address $IPV6TO4_RELAY)" + if [ $? -ne 0 ]; then + valid6to4config="no" + fi + else + net_log $"IPv6to4 configuration needs an IPv4 address on related interface or otherwise specified" info + valid6to4config="no" + fi + + # Setup 6to4 tunnel (hardwired name is "tun6to4"), if config is valid + if [ "$valid6to4config" = "yes" ]; then + # Get MTU of master device + ipv4mtu="$(/sbin/ip link show dev $DEVICE | awk '/\/ { print $5 }')" + if [ -n "$ipv4mtu" ]; then + # IPv6 tunnel MTU is IPv4 MTU minus 20 for IPv4 header + tunnelmtu=$(($ipv4mtu-20)) + fi + + if [ -n "$IPV6TO4_MTU" ]; then + if [ $IPV6TO4_MTU -gt $tunnelmtu ]; then + net_log $"Warning: configured MTU '$IPV6TO4_MTU' for 6to4 exceeds maximum limit of '$tunnelmtu', ignored" warning + else + tunnelmtu=$IPV6TO4_MTU + fi + fi + + ipv6_add_6to4_tunnel tun6to4 $ipv4addr "" $tunnelmtu $ipv4addrlocal || exit 1 + + # Add route to for compatible addresses (removed later again) + ipv6_add_route "::/96" "::" tun6to4 + + # Add default route, if device matches + if [ "$IPV6_DEFAULTDEV" = "tun6to4" ]; then + if [ -n "$IPV6_DEFAULTGW" ]; then + net_log $"Warning: interface 'tun6to4' does not support 'IPV6_DEFAULTGW', ignored" warning + fi + ipv6_set_default_route $ipv6to4_relay tun6to4 + fi + + # Add static routes + if [ -f /etc/sysconfig/static-routes-ipv6 ]; then + LC_ALL=C grep -w "^tun6to4" /etc/sysconfig/static-routes-ipv6 | while read device network gateway; do + if [ -z "$network" ]; then + continue + fi + if [ -z "$gateway" ]; then + gateway="$ipv6to4_relay" + fi + ipv6_add_route $network $gateway tun6to4 + done + fi + + # Setup additional static IPv6 routes (newer config style) + if [ -f "/etc/sysconfig/network-scripts/route6-tun6to4" ]; then + sed -ne 's/#.*//' -e '/[^[:space:]]/p' /etc/sysconfig/network-scripts/route6-tun6to4 | while read line; do + if echo "$line" | LC_ALL=C grep -vq 'via'; then + # Add gateway if missing + line="$line via $ipv6to4_relay" + fi + /sbin/ip -6 route add $line + done + fi + + # Cleanup autmatically generated autotunnel (not needed for 6to4) + /sbin/ip -6 route del ::/96 dev tun6to4 + /sbin/ip -6 addr del "::$ipv4addrlocal/128" dev tun6to4 + + if [ "$IPV6_CONTROL_RADVD" = "yes" ]; then + # RADVD is in use, so forwarding of IPv6 packets should be enabled, display warning + if [ $ipv6_global_forwarding_current -ne 1 ]; then + net_log $"Using 6to4 and RADVD IPv6 forwarding usually should be enabled, but it isn't" warning + fi + + if [ -n "$IPV6TO4_ROUTING" ]; then + ipv6to4prefix="$(ipv6_create_6to4_prefix $ipv4addr)" + if [ -n "$ipv6to4prefix" ]; then + # Add route to local networks + for devsuf in $IPV6TO4_ROUTING; do + dev="${devsuf%%-*}" + suf="$(echo $devsuf | awk -F- '{ print $2 }')" + ipv6_add_addr_on_device ${dev} ${ipv6to4prefix}${suf} + done + else + net_log $"Error occurred while calculating the IPv6to4 prefix" + fi + else + net_log $"radvd control enabled, but config is not complete" + fi + + # Control running radvd + ipv6_trigger_radvd up "$IPV6_RADVD_TRIGGER_ACTION" $IPV6_RADVD_PIDFILE + fi + else + net_log $"6to4 configuration is not valid" + exit 1 + fi +fi + +#wait for all global IPv6 addresses to leave the "tentative" state +ipv6_wait_tentative $DEVICE diff --git a/network-scripts/ifup-plip b/network-scripts/ifup-plip new file mode 100755 index 00000000..2cea68b4 --- /dev/null +++ b/network-scripts/ifup-plip @@ -0,0 +1,27 @@ +#!/bin/sh + +cd /etc/sysconfig/network-scripts +. ./network-functions + +CONFIG=$1 +source_config + +if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" ]; then + exit +fi + +[ -z "$PREFIX" ] && eval $(/bin/ipcalc --prefix ${IPADDR} ${NETMASK}) +ip addr add ${IPADDR} peer ${REMIP}/${PREFIX} dev ${DEVICE} +ip link set up dev ${DEVICE} +ip route add ${NETWORK} dev ${DEVICE} + +. /etc/sysconfig/network + +if [ "${GATEWAY}" != "" ]; then + if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then + # set up default gateway + ip route replace default ${METRIC:+metric $METRIC} via ${GATEWAY} + fi +fi + +/etc/sysconfig/network-scripts/ifup-post $1 diff --git a/network-scripts/ifup-plusb b/network-scripts/ifup-plusb new file mode 100755 index 00000000..1b29afeb --- /dev/null +++ b/network-scripts/ifup-plusb @@ -0,0 +1,43 @@ +#!/bin/sh +# +# /etc/sysconfig/network-scripts/ifup-plusb +# +# the plusb network driver is a USB host-host cable based on the Prolific +# chip. It works a lot like the plip driver. +# +# To get the plusb module to load automatically at boot, you will need to +# add the following lines to /etc/conf.modules: +# +# alias plusb0 plusb +# + +cd /etc/sysconfig/network-scripts +. ./network-functions + +CONFIG=$1 +source_config + +if [ "foo$2" = "fooboot" -a "${ONBOOT}" = "no" ] +then + exit +fi + +[ -z "$PREFIX" ] && eval $(/bin/ipcalc --prefix ${IPADDR} ${NETMASK}) + +if [ ${BROADCAST} != "" ] ; then + ip addr add ${IPADDR} peer ${REMIP}/${PREFIX} broadcast ${BROADCAST} dev ${DEVICE} +else + ip addr add ${IPADDR} peer ${REMIP}/${PREFIX} dev ${DEVICE} +fi +ip link set up dev ${DEVICE} + +. /etc/sysconfig/network + +if [ "${GATEWAY}" != "" ]; then + if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then + # set up default gateway + ip route replace default ${METRIC:+metric $METRIC} via ${GATEWAY} + fi +fi + +/etc/sysconfig/network-scripts/ifup-post $1 diff --git a/network-scripts/ifup-post b/network-scripts/ifup-post new file mode 100755 index 00000000..f8a91add --- /dev/null +++ b/network-scripts/ifup-post @@ -0,0 +1,151 @@ +#!/bin/bash + +# Source the general functions for is_true() and is_false(): +. /etc/init.d/functions + +cd /etc/sysconfig/network-scripts +. ./network-functions + +[ -f ../network ] && . ../network + +unset REALDEVICE +if [ "$1" = --realdevice ] ; then + REALDEVICE=$2 + shift 2 +fi + +CONFIG=$1 +source_config + +[ -z "$REALDEVICE" ] && REALDEVICE=$DEVICE + +if is_false "$ISALIAS"; then + /etc/sysconfig/network-scripts/ifup-aliases ${DEVICE} ${CONFIG} +fi + +if ! is_true "$NOROUTESET"; then + /etc/sysconfig/network-scripts/ifup-routes ${REALDEVICE} ${DEVNAME} +fi + + +if ! is_false "${PEERDNS}" || ! is_false "${RESOLV_MODS}"; then + # Obtain the DNS entries when using PPP if necessary: + [ -n "${MS_DNS1}" ] && DNS1="${MS_DNS1}" + [ -n "${MS_DNS2}" ] && DNS2="${MS_DNS2}" + + # Remove duplicate DNS entries and shift them, if necessary: + update_DNS_entries + + # Determine what regexp we should use (for testing below): + if [ -n "${DNS3}" ]; then + grep_regexp="[^#]?nameserver[[:space:]]+${DNS1}[^#]?nameserver[[:space:]]+${DNS2}[^#]?nameserver[[:space:]]+${DNS3}" + elif [ -n "${DNS2}" ]; then + grep_regexp="[^#]?nameserver[[:space:]]+${DNS1}[^#]?nameserver[[:space:]]+${DNS2}" + elif [ -n "${DNS1}" ]; then + grep_regexp="[^#]?nameserver[[:space:]]+${DNS1}" + else + # No DNS entries used at all ->> match everything. + grep_regexp=".*" + fi + + # Test if the search field needs updating, or + # if the nameserver entries order should be updated: + if [ -n "${DOMAIN}" ] && ! grep -q "^search.*${DOMAIN}.*$" /etc/resolv.conf || + ! tr --delete '\n' < /etc/resolv.conf | grep -E -q "${grep_regexp}"; then + + if tmp_file=$(mktemp); then + search_str='' + + while read line; do + case ${line} in + + # Skip nameserver entries when at least one DNS option was given + # (at this stage we know that we have to update all the nameserver + # enries anyway -- see below), or copy them if we are changing just + # the 'search' field in /etc/resolv.conf: + nameserver*) + if [[ "${grep_regexp}" != ".*" ]]; then + continue + else + echo "${line}" >> "${tmp_file}" + fi + ;; + + domain* | search*) + if [ -n "${DOMAIN}" ]; then + read search value < <(echo ${line}) + search_str+=" ${value}" + else + echo "${line}" >> "${tmp_file}" + fi + ;; + + # Keep the rest of the /etc/resolv.conf as it was: + *) + echo "${line}" >> "${tmp_file}" + ;; + esac + done < /etc/resolv.conf + + # Insert the domain into 'search' field: + if [ -n "${DOMAIN}" ]; then + echo "search ${DOMAIN}${search_str}" >> "${tmp_file}" + fi + + # Add the requested nameserver entries: + [ -n "${DNS1}" ] && echo "nameserver ${DNS1}" >> "${tmp_file}" + [ -n "${DNS2}" ] && echo "nameserver ${DNS2}" >> "${tmp_file}" + [ -n "${DNS3}" ] && echo "nameserver ${DNS3}" >> "${tmp_file}" + + # Backup resolv.conf only if it doesn't exist already: + ! [ -f /etc/resolv.conf.save ] && cp -af /etc/resolv.conf /etc/resolv.conf.save + + # Maintain permissions, but set umask in case it doesn't exist: + umask_old=$(umask) + umask 022 + + # Update the resolv.conf: + change_resolv_conf "${tmp_file}" + + rm -f "${tmp_file}" + umask ${umask_old} + unset tmp_file search_str umask_old + else + net_log $"/etc/resolv.conf was not updated: failed to create temporary file" 'err' 'ifup-post' + fi + fi + + unset grep_regexp +fi + +# don't set hostname on ppp/slip connections +if [ "$2" = "boot" -a \ + "${DEVICE}" != lo -a \ + "${DEVICETYPE}" != "ppp" -a \ + "${DEVICETYPE}" != "slip" ]; then + if need_hostname; then + IPADDR=$(LANG=C ip -o -4 addr ls dev ${DEVICE} | awk '{ print $4 ; exit }') + eval $(/bin/ipcalc --silent --hostname ${IPADDR} ; echo "status=$?") + if [ "$status" = "0" ]; then + set_hostname $HOSTNAME + fi + fi +fi + +# Set firewall ZONE for this device (empty means default): +if [ "${REALDEVICE}" != "lo" ]; then + dbus-send --system --dest=org.fedoraproject.FirewallD1 \ + /org/fedoraproject/FirewallD1 \ + org.fedoraproject.FirewallD1.zone.changeZoneOfInterface \ + string:"${ZONE}" string:"${DEVICE}" \ + > /dev/null 2>&1 +fi + +# Notify programs that have requested notification +do_netreport + +if [ -x /sbin/ifup-local ]; then + /sbin/ifup-local ${DEVICE} +fi + +exit 0 diff --git a/network-scripts/ifup-routes b/network-scripts/ifup-routes new file mode 100755 index 00000000..517c2bbb --- /dev/null +++ b/network-scripts/ifup-routes @@ -0,0 +1,76 @@ +#! /bin/bash +# +# adds static routes which go through device $1 + +if [ -z "$1" ]; then + echo $"usage: ifup-routes []" + exit 1 +fi + +MATCH='^[[:space:]]*(\#.*)?$' + +handle_file () { + . $1 + routenum=0 + while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do + eval $(ipcalc -p $(eval echo '$'ADDRESS$routenum) $(eval echo '$'NETMASK$routenum)) + line="$(eval echo '$'ADDRESS$routenum)/$PREFIX" + if [ "x$(eval echo '$'GATEWAY$routenum)x" != "xx" ]; then + line="$line via $(eval echo '$'GATEWAY$routenum)" + fi + line="$line dev $2" + /sbin/ip route add $line + routenum=$(($routenum+1)) + done +} + +handle_ip_file() { + local f t type= file=$1 proto="-4" + f=${file##*/} + t=${f%%-*} + type=${t%%6} + if [ "$type" != "$t" ]; then + proto="-6" + fi + { cat "$file" ; echo ; } | while read line; do + if [[ ! "$line" =~ $MATCH ]]; then + /sbin/ip $proto $type add $line + fi + done +} + +FILES="/etc/sysconfig/network-scripts/route-$1 /etc/sysconfig/network-scripts/route6-$1" +if [ -n "$2" -a "$2" != "$1" ]; then + FILES="$FILES /etc/sysconfig/network-scripts/route-$2 /etc/sysconfig/network-scripts/route6-$2" +fi + +for file in $FILES; do + if [ -f "$file" ]; then + if grep -Eq '^[[:space:]]*ADDRESS[0-9]+=' $file ; then + # new format + handle_file $file ${1%:*} + else + # older format + handle_ip_file $file + fi + fi +done + + +# Red Hat network configuration format +NICK=${2:-$1} +CONFIG="/etc/sysconfig/network-scripts/$NICK.route" +[ -f $CONFIG ] && handle_file $CONFIG $1 + + +# Routing rules +FILES="/etc/sysconfig/network-scripts/rule-$1 /etc/sysconfig/network-scripts/rule6-$1" +if [ -n "$2" -a "$2" != "$1" ]; then + FILES="$FILES /etc/sysconfig/network-scripts/rule-$2 /etc/sysconfig/network-scripts/rule6-$2" +fi + +for file in $FILES; do + if [ -f "$file" ]; then + handle_ip_file $file + fi +done diff --git a/network-scripts/ifup-sit b/network-scripts/ifup-sit new file mode 100755 index 00000000..3daa3801 --- /dev/null +++ b/network-scripts/ifup-sit @@ -0,0 +1,108 @@ +#!/bin/bash +# +# ifup-sit +# +# +# Taken from: +# (P) & (C) 2000-2003 by Peter Bieringer +# +# You will find more information on the initscripts-ipv6 homepage at +# http://www.deepspace6.net/projects/initscripts-ipv6.html +# +# RHL integration assistance by Pekka Savola +# +# Version: 2003-09-08 +# +# Uses following information from /etc/sysconfig/network: +# IPV6_DEFAULTDEV=: controls default route (optional) +# IPV6_DEFAULTGW=
: controls default route (optional) +# +# Uses following information from /etc/sysconfig/network-scripts/ifcfg-$1: +# DEVICE= +# IPV6INIT=yes|no: controls IPv6 configuration for this interface +# IPV6_MTU=: controls IPv6 MTU for this link (optional) +# +# For static tunnels +# IPV6TUNNELIPV4=: IPv4 address of remote tunnel endpoint +# IPV6TUNNELIPV4LOCAL=: (optional) local IPv4 address of tunnel +# IPV6ADDR=[/]: (optional) local IPv6 address of a numbered tunnel +# IPV6ADDR_SECONDARIES="[/] ..." (optional) additional local IPv6 addresses +# + + +. /etc/sysconfig/network + +cd /etc/sysconfig/network-scripts +. ./network-functions + +CONFIG=$1 +[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG +source_config + +# IPv6 don't need aliases anymore, config is skipped +REALDEVICE=${DEVICE%%:*} +[ "$DEVICE" != "$REALDEVICE" ] && exit 0 + +# Test whether IPv6 configuration is disabled for this interface +is_false "$IPV6INIT" && exit 0 + +[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1 +. /etc/sysconfig/network-scripts/network-functions-ipv6 + + +# IPv6 test, module loaded, exit if system is not IPv6-ready +ipv6_test || exit 1 + +# Generic tunnel device sit0 is not supported here +if [ "$DEVICE" = "sit0" ]; then + net_log $"Device '$DEVICE' isn't supported here, use IPV6_AUTOTUNNEL setting and restart (IPv6) networking" + exit 1 +fi + +if [ -z "$IPV6TUNNELIPV4" ]; then + net_log $"Missing remote IPv4 address of tunnel, configuration is not valid" + exit 1 +fi + +# Test device status +ipv6_test_device_status $DEVICE +if [ $? = 0 ]; then + # device is already up + net_log $"Device '$DEVICE' is already up, please shutdown first" + exit 1 +fi + +# Create tunnel +ipv6_add_tunnel_device $DEVICE $IPV6TUNNELIPV4 "" $IPV6TUNNELIPV4LOCAL || exit 1 + +# Set IPv6 MTU, if given +if [ -n "$IPV6_MTU" ]; then + ipv6_set_mtu $DEVICE $IPV6_MTU +fi + +# Apply local IPv6 address, if given (numbered tunnel) +if [ -n "$IPV6ADDR" ]; then + ipv6_add_addr_on_device $DEVICE $IPV6ADDR +fi + +# Setup additional IPv6 addresses from list, if given +if [ -n "$IPV6ADDR_SECONDARIES" ]; then + for ipv6addr in $IPV6ADDR_SECONDARIES; do + ipv6_add_addr_on_device $DEVICE $ipv6addr + done +fi + +# Setup default IPv6 route, check are done by function +if [ -n "$IPV6_DEFAULTDEV" -o -n "$IPV6_DEFAULTGW" ]; then + ipv6_set_default_route "$IPV6_DEFAULTGW" "$IPV6_DEFAULTDEV" "$DEVICE" +fi + +# Setup additional static IPv6 routes on specified interface, if given +if [ -f /etc/sysconfig/static-routes-ipv6 ]; then + LC_ALL=C grep -w "^$DEVICE" /etc/sysconfig/static-routes-ipv6 | while read device ipv6route args; do + ipv6_add_route $ipv6route :: $DEVICE +done +fi + +# Setup static routes +/etc/sysconfig/network-scripts/ifup-routes ${REALDEVICE} diff --git a/network-scripts/ifup-tunnel b/network-scripts/ifup-tunnel new file mode 100755 index 00000000..afdfe928 --- /dev/null +++ b/network-scripts/ifup-tunnel @@ -0,0 +1,94 @@ +#!/bin/bash +# Copyright (C) 1996-2009 Red Hat, Inc. all rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Thanks to: +# - Razvan Corneliu C.R. Vilt +# - Aaron Hope +# - Sean Millichamp +# for providing the scripts this one is based on + +. /etc/init.d/functions + +cd /etc/sysconfig/network-scripts +. ./network-functions + +CONFIG=$1 +need_config "$CONFIG" +source_config + +if [ "$PEER_OUTER_IPADDR" = "$PEER_INNER_IPADDR" ]; then + # Specifying PEER_INNER_IPADDR would automatically add a route to the peer + # through the tunnel, redirecting tunnel packets back to the tunnel and + # creating a dead loop. + unset PEER_INNER_IPADDR +fi + +case "$TYPE" in +GRE) + MODE=gre + proto=-4 + /sbin/modprobe ip_gre + ;; +IPIP) + MODE=ipip + proto=-4 + /sbin/modprobe ipip + ;; +IPIP6|EXTERNAL) + MODE=ipip6 + proto=-6 + /sbin/modprobe ip6_tunnel + ;; +*) + net_log $"Invalid tunnel type $TYPE" + exit 1 + ;; +esac + +# Generic tunnel devices are not supported here +if [ "$DEVICE" = gre0 -o "$DEVICE" = tunl0 -o "$DEVICE" = ip6tnl0 ]; then + net_log $"Device '$DEVICE' isn't supported as a valid GRE device name." + exit 1 +fi + +# Create the tunnel +# The outer addresses are those of the underlying (public) network. +if [ "$TYPE" = 'EXTERNAL' ]; then + /sbin/ip link add "$DEVICE" type ip6tnl external +else + /sbin/ip $proto tunnel add "$DEVICE" mode "$MODE" \ + ${MY_OUTER_IPADDR:+local "$MY_OUTER_IPADDR"} \ + ${PEER_OUTER_IPADDR:+remote "$PEER_OUTER_IPADDR"} \ + ${KEY:+key "$KEY"} ${TTL:+ttl "$TTL"} +fi + +if [ -n "$MTU" ]; then + /sbin/ip link set "$DEVICE" mtu "$MTU" +fi + +# The inner address are used mainly for communication between a gateway +# and a private network. When the peer is configured with an inner address +# contained in the peer's private network or identical to it's public address, +# it need not be specified. +/sbin/ip addr add "$MY_INNER_IPADDR" dev "$DEVICE" \ + ${PEER_INNER_IPADDR:+peer "$PEER_INNER_IPADDR"} + +/sbin/ip link set dev "$DEVICE" up + +# IPv6 initialisation? +/etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG} + +exec /etc/sysconfig/network-scripts/ifup-post "$CONFIG" "$2" diff --git a/network-scripts/ifup-wireless b/network-scripts/ifup-wireless new file mode 100755 index 00000000..702b6199 --- /dev/null +++ b/network-scripts/ifup-wireless @@ -0,0 +1,62 @@ +#!/bin/bash +# Network Interface Configuration System +# Copyright (c) 1996-2009 Red Hat, Inc. all rights reserved. +# +# Based on PCMCIA wireless script by (David Hinds/Jean Tourrilhes) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Configure wireless network device options. See iw(8) for more info. +# Valid variables: +# MODE: Ad-Hoc, Managed, etc. +# ESSID: Name of the wireless network +# FREQ: Frequency to operate on. See CHANNEL +# KEY: Encryption key for WEP. + +# Only meant to be called from ifup. + +cd /etc/sysconfig/network-scripts +. ./network-functions + +IW=${IW:-iw} + +[ "$KEY" ] && KEYS="key d:0:$KEY" + +shopt -s nocasematch + +case "$MODE" in +managed) + if [ "$ESSID" ]; then + $IW dev "$DEVICE" set type managed + $IW dev "$DEVICE" connect -w "$ESSID" $FREQ $KEYS + fi + ;; +ad-hoc) + if [ -n "$ESSID" -a -n "$FREQ" ]; then + $IW dev "$DEVICE" set type ibss + $IW dev "$DEVICE" ibss join "$ESSID" "$FREQ" $KEYS + fi + ;; +monitor) + if [ "$FREQ" ]; then + $IW dev "$DEVICE" set type monitor + $IW dev "$DEVICE" set freq "$FREQ" + fi + ;; +esac + +if [ -n "$WOWLAN" ] ; then + PHYDEVICE=$(phy_wireless_device $DEVICE) + iw phy $PHYDEVICE wowlan enable ${WOWLAN} +fi diff --git a/network-scripts/init.ipv6-global b/network-scripts/init.ipv6-global new file mode 100755 index 00000000..b20ff72e --- /dev/null +++ b/network-scripts/init.ipv6-global @@ -0,0 +1,164 @@ +#!/bin/bash +# +# init.ipv6-global +# +# +# Taken from: init.ipv6-global +# (P) & (C) 2001-2005 by Peter Bieringer +# +# You will find more information on the initscripts-ipv6 homepage at +# http://www.deepspace6.net/projects/initscripts-ipv6.html +# +# RHL integration assistance by Pekka Savola +# +# Version: 2005-01-04 +# +# Calling parameters: +# $1: action (currently supported: start|stop|showsysctl) +# $2: position for start|stop (currently supported: pre|post) +# +# Called by hooks from /etc/[rc.d/]init.d/network +# +# Uses following information from /etc/sysconfig/network: +# IPV6FORWARDING=yes|no: controls global IPv6 forwarding (default: no) +# IPV6_AUTOCONF=yes|no: controls global automatic IPv6 configuration +# (default: yes if IPV6FORWARDING=no, no if IPV6FORWARDING=yes) +# IPV6_AUTOTUNNEL=yes|no: controls automatic IPv6 tunneling (default: no) +# IPV6_DEFAULTGW= [optional] +# IPV6_DEFAULTDEV= [optional] +# + +. /etc/sysconfig/network + +cd /etc/sysconfig/network-scripts +. ./network-functions + +# Get action and hook position +ACTION="$1" +POSITION="$2" + +[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1 +. /etc/sysconfig/network-scripts/network-functions-ipv6 + +# Initialize IPv6, depending on caller option +case $ACTION in +start) + case $POSITION in + pre) + # IPv6 test, module loaded, exit if system is not IPv6-ready + ipv6_test || exit 1 + + if [ "$IPV6FORWARDING" = "yes" ]; then + ipv6_global_forwarding=1 + ipv6_global_auto=0 + else + ipv6_global_forwarding=0 + if [ "$IPV6_AUTOCONF" = "no" ]; then + ipv6_global_auto=0 + else + ipv6_global_auto=1 + fi + fi + + if [ ! "$IPV6_SET_SYSCTLS" = "no" ]; then + # Reset IPv6 sysctl switches for "all", "default" and still existing devices + for i in /proc/sys/net/ipv6/conf/* ; do + interface=${i##*/} + sinterface=${interface/.//} + # Host/Router behaviour for the interface + /sbin/sysctl -e -w net.ipv6.conf.$sinterface.forwarding=$ipv6_global_forwarding >/dev/null 2>&1 + + # Autoconfiguration and redirect handling for Hosts + /sbin/sysctl -e -w net.ipv6.conf.$sinterface.accept_ra=$ipv6_global_auto >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.$sinterface.accept_redirects=$ipv6_global_auto >/dev/null 2>&1 + done + fi + ;; + + post) + # IPv6 test, module loaded, exit if system is not IPv6-ready + ipv6_test || exit 1 + + if [ "$IPV6_AUTOTUNNEL" = "yes" ]; then + ipv6_enable_autotunnel + # autotunnel interface doesn't require a MTU setup + fi + + ## Add some routes which should never appear on the wire + # Unreachable IPv4-only addresses, normally blocked by source address selection + /sbin/ip route add unreach ::ffff:0.0.0.0/96 + # Unreachable IPv4-mapped addresses + /sbin/ip route add unreach ::0.0.0.0/96 + # Unreachable 6to4: IPv4 multicast, reserved, limited broadcast + /sbin/ip route add unreach 2002:e000::/19 + # Unreachable 6to4: IPv4 loopback + /sbin/ip route add unreach 2002:7f00::/24 + # Unreachable 6to4: IPv4 private (RFC 1918) + /sbin/ip route add unreach 2002:0a00::/24 + /sbin/ip route add unreach 2002:ac10::/28 + /sbin/ip route add unreach 2002:c0a8::/32 + # Unreachable 6to4: IPv4 private (APIPA / DHCP link-local) + /sbin/ip route add unreach 2002:a9fe::/32 + # Unreachable IPv6: 6bone test addresses + /sbin/ip route add unreach 3ffe:ffff::/32 + + # Set default route for autotunnel, if specified + if [ "$IPV6_DEFAULTDEV" = "sit0" -a "$IPV6_AUTOTUNNEL" = "yes" ]; then + if [ -n "$IPV6_DEFAULTGW" ]; then + ipv6_set_default_route $IPV6_DEFAULTGW $IPV6_DEFAULTDEV sit0 + elif [ -n "$IPV6_DEFAULTDEV" ]; then + ipv6_set_default_route "" $IPV6_DEFAULTDEV sit0 + fi + fi + ;; + + *) + echo "Usage: $0 $1 {pre|post}" + ;; + + esac + ;; + +stop) + case $POSITION in + pre) + ;; + + post) + # IPv6 test, no module loaded, exit if system is not IPv6-ready + ipv6_test testonly || exit 0 + + if [ ! "$IPV6_SET_SYSCTLS" = "no" ]; then + for i in /proc/sys/net/ipv6/conf/* ; do + interface=${i##*/} + sinterface=${interface/.//} + # Assume Host behaviour + /sbin/sysctl -e -w net.ipv6.conf.$sinterface.forwarding=0 >/dev/null 2>&1 + + # Disable autoconfiguration and redirects + /sbin/sysctl -e -w net.ipv6.conf.$sinterface.accept_ra=0 >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.$sinterface.accept_redirects=0 >/dev/null 2>&1 + done + fi + + # Cleanup still existing tunnel devices + ipv6_cleanup_tunnel_devices + + # Shut down generic tunnel interface now + if ipv6_test_device_status sit0 ; then + /sbin/ip link set sit0 down + fi + ;; + + *) + echo "Usage: $0 $1 {pre|post}" + ;; + + esac + ;; + +*) + echo $"Usage: $0 {start|stop|reload|restart|showsysctl}" + exit 1 + ;; +esac diff --git a/network-scripts/network-functions b/network-scripts/network-functions new file mode 100644 index 00000000..c2756b19 --- /dev/null +++ b/network-scripts/network-functions @@ -0,0 +1,744 @@ +# -*-Shell-script-*- +# +# This file is not a stand-alone shell script; it provides functions +# to network scripts that source it. + +# Set up a default search path. +PATH="/sbin:/usr/sbin:/bin:/usr/bin" +export PATH + +# We need to initialize the $HOSTNAME variable by ourselves now: +# (It was previously done for RHEL-6 branch, but got lost in time.) +HOSTNAME="$(hostname)" + +[ -z "$__sed_discard_ignored_files" ] && . /etc/init.d/functions + +get_hwaddr () +{ + if [ -f /sys/class/net/${1}/address ]; then + tr '[a-z]' '[A-Z]' < /sys/class/net/${1}/address + elif [ -d "/sys/class/net/${1}" ]; then + LC_ALL= LANG= ip -o link show ${1} 2>/dev/null | \ + awk '{ print toupper(gensub(/.*link\/[^ ]* ([[:alnum:]:]*).*/, + "\\1", 1)); }' + fi +} + +get_config_by_device () +{ + LANG=C grep -l "^[[:space:]]*DEVICE=['\"]\?${1}['\"]\?\([[:space:]#]\|$\)" \ + /etc/sysconfig/network-scripts/ifcfg-* \ + | LC_ALL=C sed -e "$__sed_discard_ignored_files" +} + +get_config_by_hwaddr () +{ + LANG=C grep -il "^[[:space:]]*HWADDR=['\"]\?${1}['\"]\?\([[:space:]#]\|$\)" /etc/sysconfig/network-scripts/ifcfg-* \ + | LC_ALL=C sed -e "$__sed_discard_ignored_files" +} + +get_config_by_subchannel () +{ + LANG=C grep -E -i -l \ + "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){0,2}${1}(,[0-9]\.[0-9]\.[a-f0-9]+){0,2}['\"]?([[:space:]]+#|[[:space:]]*$)" \ + /etc/sysconfig/network-scripts/ifcfg-* \ + | LC_ALL=C sed -e "$__sed_discard_ignored_files" +} + +get_config_by_name () +{ + LANG=C grep -E -i -l "^[[:space:]]*NAME=\"(Auto |System )?${1}\"" \ + /etc/sysconfig/network-scripts/ifcfg-* \ + | LC_ALL=C sed -e "$__sed_discard_ignored_files" +} + +get_device_by_hwaddr () +{ + LANG=C ip -o link | awk -F ': ' -vIGNORECASE=1 '!/link\/ieee802\.11/ && /'"$1"'/ { print $2 }' +} + +get_uuid_by_config () +{ + dbus-send --system --print-reply --dest=com.redhat.ifcfgrh1 /com/redhat/ifcfgrh1 com.redhat.ifcfgrh1.GetIfcfgDetails string:"/etc/sysconfig/network-scripts/$1" 2>/dev/null | awk -F '"' '/string / { print $2 }' +} + +generate_lease_file_name () +{ + local ver=$1 + LEASEFILE="/var/lib/dhclient/dhclient$ver-${DEVICE}.leases" + if [ -f $LEASEFILE ]; then + return + fi + LEASEFILE="/var/lib/dhclient/dhclient$ver-${UUID}-${DEVICE}.lease" +} + +generate_config_file_name () +{ + local ver=$1 + if [ -s /etc/dhcp/dhclient$ver-${DEVICE}.conf ]; then + DHCLIENTCONF="-cf /etc/dhcp/dhclient$ver-${DEVICE}.conf"; + elif [ -s /etc/dhclient$ver-${DEVICE}.conf ]; then + DHCLIENTCONF="-cf /etc/dhclient$ver-${DEVICE}.conf"; + else + DHCLIENTCONF=''; + fi +} + +need_config () +{ + local nconfig + + CONFIG="ifcfg-${1}" + [ -f "${CONFIG}" ] && return + CONFIG="${1##*/}" + [ -f "${CONFIG}" ] && return + nconfig=$(get_config_by_name "${1}") + if [ -n "$nconfig" ] && [ -f "$nconfig" ]; then + CONFIG=${nconfig##*/} + return + fi + local addr=$(get_hwaddr ${1}) + if [ -n "$addr" ]; then + nconfig=$(get_config_by_hwaddr ${addr}) + if [ -n "$nconfig" ] ; then + CONFIG=${nconfig##*/} + [ -f "${CONFIG}" ] && return + fi + fi + nconfig=$(get_config_by_device ${1}) + if [ -n "$nconfig" ] && [ -f "$nconfig" ]; then + CONFIG=${nconfig##*/} + return + fi +} + +source_config () +{ + CONFIG=${CONFIG##*/} + DEVNAME=${CONFIG##ifcfg-} + . /etc/sysconfig/network-scripts/$CONFIG + [ -r "keys-$DEVNAME" ] && . /etc/sysconfig/network-scripts/keys-$DEVNAME + case "$TYPE" in + Ethernet) + DEVICETYPE="eth" + ;; + CIPE) + DEVICETYPE="cipcb" + ;; + IPSEC) + DEVICETYPE="ipsec" + ;; + Modem) + DEVICETYPE="ppp" + ;; + xDSL) + DEVICETYPE="ppp" + ;; + ISDN) + DEVICETYPE="ippp" + ;; + Wireless) + DEVICETYPE="eth" + ;; + "Token Ring") + DEVICETYPE="eth" + ;; + CTC) + DEVICETYPE="ctc" + ;; + GRE | IPIP | IPIP6) + DEVICETYPE="tunnel" + ;; + SIT | sit) + DEVICETYPE="sit" + ;; + InfiniBand | infiniband) + DEVICETYPE="ib" + ;; + OVS*) + DEVICETYPE="ovs" + ;; + esac + if [ -n "$HWADDR" ]; then + HWADDR=$(tr '[a-z]' '[A-Z]' <<<"$HWADDR") + fi + if [ -n "$MACADDR" ]; then + MACADDR=$(tr '[a-z]' '[A-Z]' <<<"$MACADDR") + fi + [ -z "$DEVICE" -a -n "$HWADDR" ] && DEVICE=$(get_device_by_hwaddr $HWADDR) + [ -z "$DEVICETYPE" ] && DEVICETYPE=$(echo ${DEVICE} | sed "s/[0-9]*$//") + [ -z "$REALDEVICE" -a -n "$PARENTDEVICE" ] && REALDEVICE=$PARENTDEVICE + [ -z "$REALDEVICE" ] && REALDEVICE=${DEVICE%%:*} + [ -z "$SYSCTLDEVICE" ] && SYSCTLDEVICE=${REALDEVICE/.//} + if [ "${DEVICE}" != "${REALDEVICE}" ]; then + ISALIAS=yes + else + ISALIAS=no + fi + if is_nm_running && [ "$REALDEVICE" != "lo" ] ; then + nm_con_load "$CONFIG" + if ! is_false $NM_CONTROLLED; then + UUID=$(get_uuid_by_config $CONFIG) + [ -n "$UUID" ] && _use_nm=true + fi + fi +} + +nm_con_load () { + dbus-send --system --print-reply \ + --dest=org.freedesktop.NetworkManager \ + /org/freedesktop/NetworkManager/Settings \ + org.freedesktop.NetworkManager.Settings.LoadConnections \ + array:string:"/etc/sysconfig/network-scripts/${1}" >/dev/null 2>&1 +} + +ethtool_set() +{ + oldifs=$IFS; + IFS=';'; + if [ -n "${ETHTOOL_DELAY}" ]; then + # Convert microseconds to seconds: + local ETHTOOL_DELAY_SEC=$(convert2sec ${ETHTOOL_DELAY} micro) + sleep ${ETHTOOL_DELAY_SEC} + fi + for opts in $ETHTOOL_OPTS ; do + IFS=$oldifs; + if [[ "${opts}" =~ [[:space:]]*- ]]; then + /sbin/ethtool $opts + else + /sbin/ethtool -s ${REALDEVICE} $opts + fi + IFS=';'; + done + IFS=$oldifs; +} + +expand_config () +{ + local i=0 val + for idx in '' {0..255} ; do + ipaddr[$i]=$(eval echo '$'IPADDR$idx) + if [ -z "${ipaddr[$i]}" ]; then + [ "$idx" ] && [ $idx -ge 2 ] && break + continue + fi + prefix[$i]=$(eval echo '$'PREFIX$idx) + netmask[$i]=$(eval echo '$'NETMASK$idx) + broadcast[$i]=$(eval echo '$'BROADCAST$idx) + arpcheck[$i]=$(eval echo '$'ARPCHECK$idx) + arpupdate[$i]=$(eval echo '$'ARPUPDATE$idx) + + if [ "${prefix[$i]}x" != "x" ]; then + val=$(/bin/ipcalc --netmask "${ipaddr[$i]}/${prefix[$i]}") + netmask[$i]=${val##NETMASK=} + fi + + if [ "${netmask[$i]}x" = "x" ]; then + val=$(/bin/ipcalc --netmask "${ipaddr[$i]}") + netmask[$i]=${val##NETMASK=} + fi + + if [ "${prefix[$i]}x" = "x" ]; then + val=$(/bin/ipcalc --prefix ${ipaddr[$i]} ${netmask[$i]}) + prefix[$i]=${val##PREFIX=} + fi + + if [ "${broadcast[$i]}x" = "x" ]; then + val=$(/bin/ipcalc --broadcast ${ipaddr[$i]} ${netmask[$i]}) + broadcast[$i]=${val##BROADCAST=} + fi + + if [ "${arpcheck[$i]}x" != "x" ]; then + arpcheck[$i]=${arpcheck[$i]##ARPCHECK=} + arpcheck[$i]=${arpcheck[$i],,*} + fi + + if [ "${arpupdate[$i]}x" != "x" ]; then + arpupdate[$i]=${arpupdate[$i]##ARPUPDATE=} + arpupdate[$i]=${arpupdate[$i],,*} + fi + + i=$((i+1)) + done + + [ -n "$DHCP_HOSTNAME" ] && DHCP_HOSTNAME=${DHCP_HOSTNAME%%.*} + + if [ -z "${NETWORK}" ]; then + eval $(/bin/ipcalc --network ${ipaddr[0]} ${netmask[0]}) + fi +} + +toggle_value () +{ + if [ "$2" = "yes" -o "$2" = "YES" ] ; then + echo "$1 on" + elif [ "$2" = "no" -o "$2" = "NO" ] ; then + echo "$1 off" + else + echo '' + fi +} + +do_netreport () +{ + # Notify programs that have requested notification + ( + cd /run/netreport || exit + for i in * ; do + if [ -f $i ]; then + if [ "$(id -u)" = "0" ]; then + OWNER=$(stat -c %U $i) + su -s /bin/bash $OWNER -c "kill -SIGIO $i >/dev/null 2>&1 || rm -f $i >/dev/null 2>&1" > /dev/null 2>&1 + else + kill -SIGIO $i >/dev/null 2>&1 || rm -f $i >/dev/null 2>&1 + fi + fi + done + ) +} + +is_nm_running () +{ + dbus-send --system --print-reply \ + --dest=org.freedesktop.DBus \ + /org/freedesktop/DBus \ + org.freedesktop.DBus.GetNameOwner \ + string:"org.freedesktop.NetworkManager" >/dev/null 2>&1 +} + +is_nm_active () +{ + LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^${1}:connected$" +} + +is_nm_handling () +{ + LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^\(${1}:connected\)\|\(${1}:connecting.*\)$" +} + +is_nm_device_unmanaged () +{ + LANG=C nmcli -t --fields GENERAL dev show "${1}" 2>/dev/null | awk -F ':' '/GENERAL.STATE/ { if ($2 == "unmanaged") exit 0 ; else exit 1; }' +} + +# Sets $alias to the device module if $? != 0 +is_available () +{ + [ -z "$1" ] && return 1 + + [ -d "/sys/class/net/$1" ] && return 0 + + [ -n "$BONDING_OPTS" ] && install_bonding_driver $1 + + alias=$(modprobe -c | awk \ + 'BEGIN { alias = ""; } + $1 == "alias" && $2 == "'"$1"'" { alias = $3; } + $1 == "install" { install[$2] = $3; } + END { + cmd = install[alias]; + print alias; + if (alias == "" || alias == "off" || cmd == "/bin/true" || cmd == ":") + exit 1; + exit 0; + } + ') + [ $? -eq 0 ] || return 2 + + modprobe $1 > /dev/null 2>&1 || { + return 1 + } + if [ -n "$HWADDR" ]; then + local curdev=$(get_device_by_hwaddr "$HWADDR") + if [ -z "$curdev" ]; then + return 1 + fi + fi + + if [ ${alias} = "bonding" ]; then + install_bonding_driver $1 + fi + + [ -d "/sys/class/net/$1" ] && return 0 || return 1 +} + +is_available_wait () +{ + [ -z "$1" ] && return 1 + + local retry=${2##*[!0-9]*} + + is_available $1 && return 0 + ret=$? + + while [ 0"$retry" -gt 0 ]; do + sleep 1 + [ -d "/sys/class/net/$1" ] && return 0 + retry=$(($retry -1)) + done + + return $ret +} + +is_hostname_set () +{ + case "${HOSTNAME}" in + '(none)' | 'localhost' | 'localhost.localdomain') + # Hostname NOT set: + return 1 + ;; + *) + # Hostname IS set: + return 0 + ;; + esac +} + +need_hostname () +{ + # Should we avoid obtaining hostname from DHCP? (user override) + is_true "${NO_DHCP_HOSTNAME}" && return 1 + + if is_hostname_set; then + # Hostname is already set, we do not need to acquire it: + return 1 + else + # Hostname is NOT set, we need to acquire it: + return 0 + fi +} + +set_hostname_options () +{ + # User explicitly requires to *not* send DHCP_HOSTNAME, DHCP_FQDN or HOSTNAME: + is_false "${DHCP_SEND_HOSTNAME}" && return + + if [[ -n "${DHCP_HOSTNAME}" && -n "${DHCP_FQDN}" ]]; then + net_log $"Both 'DHCP_HOSTNAME=${DHCP_HOSTNAME}' and 'DHCP_FQDN=${DHCP_FQDN}' are configured... Using DHCP_FQDN." warning + fi + + local hostname_options='' + + # DHCP_FQDN takes precedence before DHCP_HOSTNAME -- as it does in NetworkManager, + # and DHCP_HOSTNAME takes precedence before HOSTNAME: + if [[ -n "${DHCP_FQDN}" ]]; then + hostname_options="-F ${DHCP_FQDN}" + elif [[ -n "${DHCP_HOSTNAME}" ]]; then + hostname_options="-H ${DHCP_HOSTNAME}" + elif is_hostname_set; then + # We need to truncate the hostname in case it is the FQDN: + hostname_options="-H ${HOSTNAME%%.*}" + else + # Nothing to send to the DHCP server: + # ['(none)', 'localhost' or 'localhost.localdomain' are not valid] + return + fi + + # Append the hostname options to the content of passed variable name: + eval "$1='${!1} ${hostname_options}'" + + return +} + +set_hostname () +{ + hostname $1 + if ! grep search /etc/resolv.conf >/dev/null 2>&1; then + domain=$(echo $1 | sed 's/^[^\.]*\.//') + if [ -n "$domain" ]; then + rsctmp=$(mktemp /tmp/XXXXXX); + cat /etc/resolv.conf > $rsctmp + echo "search $domain" >> $rsctmp + + # Backup resolv.conf only if it doesn't exist already: + ! [ -f /etc/resolv.conf.save ] && cp -af /etc/resolv.conf /etc/resolv.conf.save + + change_resolv_conf $rsctmp + /bin/rm -f $rsctmp + fi + fi +} + +check_device_down () +{ + [ ! -d /sys/class/net/$1 ] && return 0 + if LC_ALL=C ip -o link show dev $1 2>/dev/null | grep -q ",UP" ; then + return 1 + else + return 0 + fi +} + +check_link_down () +{ + if ! LC_ALL=C ip link show dev $1 2>/dev/null| grep -q ",UP" ; then + ip link set dev $1 up >/dev/null 2>&1 + fi + timeout=0 + delay=10 + [ -n "$LINKDELAY" ] && delay=$(($LINKDELAY * 2)) + while [ $timeout -le $delay ]; do + [ "$(cat /sys/class/net/$REALDEVICE/carrier 2>/dev/null)" != "0" ] && return 1 + sleep 0.5 + timeout=$((timeout+1)) + done + return 0 +} + +check_default_route () +{ + LC_ALL=C ip route list match 0.0.0.0/0 | grep -q default +} + +find_gateway_dev () +{ + . /etc/sysconfig/network + if [ -n "${GATEWAY}" -a "${GATEWAY}" != "none" ] ; then + dev=$(LC_ALL=C /sbin/ip route get to "${GATEWAY}" 2>/dev/null | \ + sed -n 's/.* dev \([[:alnum:]]*\) .*/\1/p') + if [ -n "$dev" ]; then + GATEWAYDEV="$dev" + fi + fi +} + +# After the device $1 goes away, restore the standard default route; typically +# used for ppp with DEFROUTE temporarily replacing the "standard" default +# route. +# FIXME: This function doesn't support some newer features (GATEWAY in ifcfg, +# $WINDOW, $METRIC) +add_default_route () +{ + . /etc/sysconfig/network + check_default_route && return 0 + find_gateway_dev + if [ "$GATEWAYDEV" != "" -a -n "${GATEWAY}" -a \ + "${GATEWAY}" != "none" ]; then + if ! check_device_down $1; then + if [ "$GATEWAY" = "0.0.0.0" ]; then + /sbin/ip route add default dev ${GATEWAYDEV} + else + /sbin/ip route add default via ${GATEWAY} + fi + fi + elif [ -f /etc/default-routes ]; then + while read spec; do + /sbin/ip route add $spec + done < /etc/default-routes + rm -f /etc/default-routes + fi +} + +is_wireless_device () +{ + [ -x /usr/sbin/iw ] || return 1 + LC_ALL=C /usr/sbin/iw dev $1 info > /dev/null 2>&1 && return 0 + return 1 +} + +phy_wireless_device () +{ + cat /sys/class/net/$1/phy80211/name +} + +bond_master_exists () +{ + local bond_name + [ -z "${1}" ] && return 1 + [ ! -f /sys/class/net/bonding_masters ] && return 1 + + for bond_name in $(< /sys/class/net/bonding_masters); do + [ "${bond_name}" == "${1}" ] && return 0 + done + return 1 +} + +install_bonding_driver () +{ + local fn="install_bonding_driver" + + if ! bond_master_exists ${1}; then + modprobe bonding || return 1 + echo "+$1" > /sys/class/net/bonding_masters 2>/dev/null + fi + ( + # Set config here + need_config "$1" + source_config + if [ -f /sys/class/net/${DEVICE}/bonding/slaves ] && [ $(wc -l < /sys/class/net/${DEVICE}/bonding/slaves) -eq 0 ]; then + /sbin/ip link set dev ${DEVICE} down + + # parse options and put them to arrays + for arg in $BONDING_OPTS ; do + bopts_keys[${#bopts_keys[*]}]=${arg%%=*} + bopts_vals[${#bopts_vals[*]}]=${arg##*=} + done + + # add the bits to setup driver parameters here + # first set mode, miimon + for (( idx=0; idx < ${#bopts_keys[*]}; idx++ )) ; do + key=${bopts_keys[$idx]} + value=${bopts_vals[$idx]} + + if [ "${key}" = "mode" ] ; then + echo "${value}" > /sys/class/net/${DEVICE}/bonding/$key || { + net_log $"Failed to set value '$value' [mode] to ${DEVICE} bonding device" err $fn + } + bopts_keys[$idx]="" + fi + if [ "${key}" = "miimon" ] ; then + echo "${value}" > /sys/class/net/${DEVICE}/bonding/$key || { + net_log $"Failed to set value '$value' [miimon] to ${DEVICE} bonding device" err $fn + } + bopts_keys[$idx]="" + fi + done + + # set all other remaining options + for (( idx=0; idx < ${#bopts_keys[*]}; idx++ )) ; do + key=${bopts_keys[$idx]} + value=${bopts_vals[$idx]} + + # option already set; take next + [[ -z "$key" ]] && continue + + if [ "${key}" = "arp_ip_target" -a "${value:0:1}" != "+" ]; then + OLDIFS=$IFS; + IFS=','; + for arp_ip in $value; do + if ! grep -q $arp_ip /sys/class/net/${DEVICE}/bonding/$key; then + echo +$arp_ip > /sys/class/net/${DEVICE}/bonding/$key || { + net_log $"Failed to set '$arp_ip' value [arp_ip_target] to ${DEVICE} bonding device" err $fn + } + fi + done + IFS=$OLDIFS; + elif [ "${key}" = "arp_ip_target" ]; then + if ! grep -q ${value#+} /sys/class/net/${DEVICE}/bonding/$key; then + echo "$value" > /sys/class/net/${DEVICE}/bonding/$key || { + net_log $"Failed to set '$value' value [arp_ip_target] to ${DEVICE} bonding device" err $fn + } + fi + elif [ "${key}" != "primary" ]; then + echo $value > /sys/class/net/${DEVICE}/bonding/$key || { + net_log $"Failed to set '$value' value [$key] to ${DEVICE} bonding device" err $fn + } + fi + done + fi + ) + return 0 +} + +is_bonding_device () +{ + [ -f "/sys/class/net/$1/bonding/slaves" ] +} + +# Invoke this when /etc/resolv.conf has changed: +change_resolv_conf () +{ + s=$(/bin/grep '^[\ \ ]*option' /etc/resolv.conf 2>/dev/null) + if [ $# -gt 1 ]; then + if [ "x$s" != "x" ]; then + s="$s"$'\n' + fi + n_args=$# + while [ $n_args -gt 0 ]; do + case "$s" in + *$1*) + shift + n_args=$(($n_args-1)) + continue + ;; + esac + s="$s$1" + shift + if [ $# -gt 0 ]; then + s="$s"$'\n' + fi + n_args=$(($n_args-1)) + done + elif [ $# -eq 1 ]; then + if [ "x$s" != "x" ]; then + s="$s"$'\n'$(/bin/grep -vF "$s" $1) + else + s=$(cat $1) + fi + fi + (echo "$s" > /etc/resolv.conf) >/dev/null 2>&1; + r=$? + if [ $r -eq 0 ]; then + [ -x /sbin/restorecon ] && /sbin/restorecon /etc/resolv.conf >/dev/null 2>&1 # reset the correct context + /usr/bin/logger -p local7.notice -t "NET" -i "$0 : updated /etc/resolv.conf" + [ -e /run/nscd/socket ] && /usr/sbin/nscd -i hosts # invalidate cache + fi + return $r +} + +# Logging function +# +# Usage: net_log +# +# Default level is 'err'. + +net_log() +{ + local message="$1" + local level="$2" + local name="$3" + + [ -z "$message" ] && return 1 + [ -z "$level" ] && level=err + [ -z "$name" ] && name=$0 + + case $level in + 'debug') + local txt_level=$"DEBUG " + ;; + 'err') + local txt_level=$"ERROR " + ;; + 'warning') + local txt_level=$"WARN " + ;; + 'info') + local txt_level=$"INFO " + ;; + esac + + echo "$txt_level: [$name] $message" + + if [ -x /usr/bin/logger ]; then + /usr/bin/logger -p daemon.$level -t "$name" "$message" + fi + return 0 +} + +update_DNS_entries() +{ + # Remove duplicate values from DNS options if any: + if [ -n "${DNS3}" ] && [[ "${DNS3}" == "${DNS2}" || "${DNS3}" == "${DNS1}" ]]; then + unset DNS3 + fi + + if [ -n "${DNS2}" ] && [[ "${DNS2}" == "${DNS1}" ]]; then + unset DNS2 + fi + + # Shift the DNS options if necessary: + if [ -z "${DNS1}" ] && [ -n "${DNS2}" ]; then + DNS1="${DNS2}" + unset DNS2 + fi + + if [ -z "${DNS2}" ] && [ -n "${DNS3}" ]; then + DNS2="${DNS3}" + unset DNS3 + fi + + # We need to check DNS1 again in case only DNS3 was set at all: + if [ -z "${DNS1}" ] && [ -n "${DNS2}" ]; then + DNS1="${DNS2}" + unset DNS2 + fi +} diff --git a/network-scripts/network-functions-ipv6 b/network-scripts/network-functions-ipv6 new file mode 100644 index 00000000..b5b3e939 --- /dev/null +++ b/network-scripts/network-functions-ipv6 @@ -0,0 +1,1084 @@ +# network-functions-ipv6 +# +# Taken from: network-functions-ipv6 +# (P) & (C) 1997-2005 by Peter Bieringer +# +# You will find more information on the initscripts-ipv6 homepage at +# http://www.deepspace6.net/projects/initscripts-ipv6.html +# +# Version: 2006-08-03 +# +# + + +##### Test for IPv6 capabilities +# $1: (optional) testflag: currently supported: "testonly" (do not load a module) +# return code: 0=ok 2=IPv6 test fails +ipv6_test() { + local fn="ipv6_test" + + local testflag=$1 + + if ! [ -f /proc/net/if_inet6 ]; then + if [ "$testflag" = "testonly" ]; then + return 2 + else + modprobe ipv6 + + if ! [ -f /proc/net/if_inet6 ]; then + return 2 + fi + fi + fi + + if ! [ -d /proc/sys/net/ipv6/conf/ ]; then + return 2 + fi + + return 0 +} + +##### Static IPv6 route configuration + +# Set static IPv6 route +# $1: : to route +# $2: : over which $1 should be routed (if "::", gw will be skipped) +# $3: [] : (optional) +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem adding route +ipv6_add_route() { + local fn="ipv6_add_route" + + local networkipv6=$1 + local gatewayipv6=$2 + local device=$3 # maybe empty + + if [ -z "$networkipv6" ]; then + net_log $"Missing parameter 'IPv6-network' (arg 1)" err $fn + return 1 + fi + + if [ -z "$gatewayipv6" ]; then + net_log $"Missing parameter 'IPv6-gateway' (arg 2)" err $fn + return 1 + fi + + ipv6_test || return 2 + + ipv6_test_ipv6_addr_valid $networkipv6 || return 2 + ipv6_test_ipv6_addr_valid $gatewayipv6 || return 2 + + if [ -z "$device" ]; then + local returntxt="$(/sbin/ip -6 route add $networkipv6 via $gatewayipv6 metric 1 2>&1)" + else + if [ "$gatewayipv6" = "::" ]; then + local returntxt="$(/sbin/ip -6 route add $networkipv6 dev $device metric 1 2>&1)" + else + local returntxt="$(/sbin/ip -6 route add $networkipv6 via $gatewayipv6 dev $device metric 1 2>&1)" + fi + fi + + if [ -n "$returntxt" ]; then + if echo $returntxt | LC_ALL=C grep -q "File exists"; then + # Netlink: "File exists" + true + elif echo $returntxt | LC_ALL=C grep -q "No route to host"; then + # Netlink: "No route to host" + net_log $"'No route to host' adding route '$networkipv6' via gateway '$gatewayipv6' through device '$device'" err $fn + return 3 + else + net_log $"Unknown error" err $fn + return 3 + fi + fi + + return 0 +} + +##### automatic tunneling configuration + +## Configure automatic tunneling up +# return code: 0=ok 2=IPv6 test fails 3=major problem +ipv6_enable_autotunnel() { + local fn="ipv6_enable_autotunnel" + + ipv6_test || return 2 + + # enable IPv6-over-IPv4 tunnels + if ipv6_test_device_status sit0; then + true + else + # bring up basic tunnel device + /sbin/ip link set sit0 up + + if ! ipv6_test_device_status sit0; then + net_log $"Tunnel device 'sit0' enabling didn't work" err $fn + return 3 + fi + + # Set sysctls proper (regardless "default") + /sbin/sysctl -e -w net.ipv6.conf.sit0.forwarding=1 >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.sit0.accept_ra=0 >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.sit0.accept_redirects=0 >/dev/null 2>&1 + fi + + return 0 +} + +##### Interface configuration + +## Add an IPv6 address for given interface +# $1: +# $2: +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_add_addr_on_device() { + local fn="ipv6_add_addr_on_device" + + local device=$1 + local address=$2 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + if [ -z "$address" ]; then + net_log $"Missing parameter 'IPv6-address' (arg 2)" err $fn + return 1 + fi + + ipv6_test || return 2 + + ipv6_test_ipv6_addr_valid $address || return 1 + + ipv6_test_device_status $device + local result=$? + + if [ "$result" = "0" ]; then + true + elif [ "$result" != "11" ]; then + net_log $"Device '$device' doesn't exist" err $fn + return 3 + else + /sbin/ip link set $device up + + if ! ipv6_test_device_status $device; then + net_log $"Device '$device' enabling didn't work" err $fn + return 3 + fi + fi + + # Extract address parts + local prefixlength_implicit="$(echo $address | awk -F/ '{ print $2 }')" + local address_implicit="${address%%/*}" + + # Check prefix length and using '64' as default + if [ -z "$prefixlength_implicit" ]; then + local prefixlength_implicit="64" + local address="$address_implicit/$prefixlength_implicit" + fi + + /sbin/ip -6 addr replace $address dev $device + local result=$? + + if [ $result -eq 2 ]; then + return 0 + elif [ $result -ne 0 ]; then + net_log $"Cannot add IPv6 address '$address' on dev '$device'" err $fn + return 3 + fi + + return 0 +} + + +## Remove all IPv6 routes and addresses on given interface (cleanup to prevent kernel crashes) +# $1: +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_cleanup_device() { + local fn="ipv6_cleanup_device" + + local device=$1 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + ipv6_test testonly || return 2 + + # Remove all IPv6 routes through this device (but not "lo") + if [ "$device" != "lo" ]; then + /sbin/ip -6 route flush dev $device scope global >/dev/null 2>&1 + /sbin/ip -6 route flush dev $device scope site >/dev/null 2>&1 + fi + + # Remove all IPv6 addresses on this interface + /sbin/ip -6 addr flush dev $device scope global >/dev/null 2>&1 + /sbin/ip -6 addr flush dev $device scope site >/dev/null 2>&1 + + return 0 +} + + +## Remove all IPv6 6to4 related routes and addresses on given interface +# $1: +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_cleanup_6to4_device() { + local fn="ipv6_cleanup_6to4_device" + + local device=$1 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + ipv6_test testonly || return 2 + + # Cleanup 6to4 addresses on this device + /sbin/ip -6 addr show dev $device scope global permanent | awk '/\/ && $2 ~ /^2002:/ { print $2 }' | while read addr; do + /sbin/ip -6 addr del ${addr} dev ${device} + done + + # Get all IPv6 routes through given interface related to 6to4 and remove them + /sbin/ip -6 route show dev $device | LC_ALL=C grep "^2002:" | while read ipv6net dummy; do + /sbin/ip -6 route del $ipv6net dev $device + done + + return 0 +} + + +##### Some address test functions + +## Test a given IPv6 address for validity +# $1: +# return code: 0=ok 1=not valid +ipv6_test_ipv6_addr_valid() { + ipcalc -cs6 $1 +} + + +## Test a given IPv4 address for validity +# $1: +# return code: 0=ok 1=not valid +ipv6_test_ipv4_addr_valid() { + ipcalc -cs4 $1 +} + + +## Test a given IPv4 address for not a private but unicast one +# $1: +# return code: 0=ok 1=argument error 10=private or not unicast +ipv6_test_ipv4_addr_global_usable() { + local fn="ipv6_test_ipv4_addr_global_usable" + + local testipv4addr_globalusable=$1 + + + if [ -z "$testipv4addr_globalusable" ]; then + return 1 + fi + + # Test for a globally usable IPv4 address now + # test 0.0.0.0/8 + /bin/ipcalc --network $testipv4addr_globalusable 255.0.0.0 | LC_ALL=C grep -q "NETWORK=0\.0\.0\.0" && return 10 + # test 10.0.0.0/8 (RFC 1918 / private) + /bin/ipcalc --network $testipv4addr_globalusable 255.0.0.0 | LC_ALL=C grep -q "NETWORK=10\.0\.0\.0" && return 10 + # test 127.0.0.0/8 (loopback) + /bin/ipcalc --network $testipv4addr_globalusable 255.0.0.0 | LC_ALL=C grep -q "NETWORK=127\.0\.0\.0" && return 10 + # test 169.254.0.0/16 (APIPA / DHCP link local) + /bin/ipcalc --network $testipv4addr_globalusable 255.255.0.0 | LC_ALL=C grep -q "NETWORK=169\.254\.0\.0" && return 10 + # test 172.16.0.0/12 (RFC 1918 / private) + /bin/ipcalc --network $testipv4addr_globalusable 255.240.0.0 | LC_ALL=C grep -q "NETWORK=172\.16\.0\.0" && return 10 + # test 192.168.0.0/16 (RFC 1918 / private) + /bin/ipcalc --network $testipv4addr_globalusable 255.255.0.0 | LC_ALL=C grep -q "NETWORK=192\.168\.0\.0" && return 10 + # test 224.0.0.0/3 (multicast and reserved, broadcast) + /bin/ipcalc --network $testipv4addr_globalusable 224.0.0.0 | LC_ALL=C grep -q "NETWORK=224\.0\.0\.0" && return 10 + + return 0 +} + + +## Test a given device for status +# $1: +# return code: 0=ok 1=argument error 10=not exists 11=down +ipv6_test_device_status() { + local fn="ipv6_test_device_status" + + local device=$1 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + # Test if device exists + if [ ! -d "/sys/class/net/${device}" ]; then + # not exists + return 10 + fi + + # Test if device is up + if /sbin/ip link show dev $device 2>/dev/null | LC_ALL=C grep -q "UP"; then + # up + return 0 + else + # down + return 11 + fi +} + + +## Create 6to4 prefix +# $1: +# stdout: <6to4address> +# return code: 0=ok 1=argument error +ipv6_create_6to4_prefix() { + local fn="ipv6_create_6to4_prefix" + + local ipv4addr=$1 + + if [ -z "$ipv4addr" ]; then + net_log $"Missing parameter 'IPv4 address' (arg 1)" err $fn + fi + + local major1="${ipv4addr%%.*}" + local minor1="$(echo $ipv4addr | awk -F. '{ print $2 }')" + local major2="$(echo $ipv4addr | awk -F. '{ print $3 }')" + local minor2="$(echo $ipv4addr | awk -F. '{ print $4 }')" + + if [ -z "$major1" -o -z "$minor1" -o -z "$major2" -o -z "$minor2" ]; then + return 1 + fi + + if [ $major1 -eq 0 ]; then + local block1="$(printf "%x" $minor1)" + else + local block1="$(printf "%x%02x" $major1 $minor1)" + fi + if [ $major2 -eq 0 ]; then + local block2="$(printf "%x" $minor2)" + else + local block2="$(printf "%x%02x" $major2 $minor2)" + fi + + local prefix6to4="2002:$block1:$block2" + + echo "$prefix6to4" + return 0 +} + + +## Check and create 6to4 tunnel relay address +# $1: +# stdout: +# return code: 0=ok 1=argument error +ipv6_create_6to4_relay_address() { + local fn="ipv6_create_6to4_relay_address" + + local addr=$1 + + if [ -z "$addr" ]; then + net_log $"Missing parameter 'address' (arg 1)" err $fn + return 1 + fi + + # Check + if ipv6_test_ipv4_addr_valid $addr ; then + # ok, an IPv4 one + if ipv6_test_ipv4_addr_global_usable $addr; then + # IPv4 globally usable + local ipv6to4_relay="::$addr" + else + net_log $"Given address '$addr' is not a global IPv4 one (arg 1)" err $fn + return 1 + fi + else + net_log $"Given address '$addr' is not a valid IPv4 one (arg 1)" err $fn + return 1 + fi + + echo "$ipv6to4_relay" + + return 0 +} + + +##### 6to4 tunneling setup + +## Configure 6to4 tunneling up +# $1: : only "tun6to4" is supported +# $2: : global IPv4 address of interface (will be used to generate 6to4 prefix) +# $3: [] : for 6to4 prefix (optional, default is "::1") +# $4: [] : MTU of tunnel device (optional, default is automatic) +# $5: [] : local IPv4 address of tunnel interface (required in case of 6to4 behind NAT) +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_add_6to4_tunnel() { + local fn="ipv6_add_6to4_tunnel" + + local device=$1 + local globalipv4=$2 + local globalipv6to4suffix=$3 + local mtu=$4 + local localipv4=$5 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + if [ -z "$globalipv4" ]; then + net_log $"Missing parameter 'global IPv4 address' (arg 2)" err $fn + return 1 + fi + + # Check device + if [ "$device" != "tun6to4" ]; then + net_log $"Given device '$device' is not supported (arg 1)" err $fn + return 1 + fi + + # Copy global IPv4 address to local if last one is not given + if [ -z "$localipv4" ]; then + localipv4="$globalipv4" + fi + + ipv6_test || return 2 + + # Generate 6to4 address + local prefix6to4="$(ipv6_create_6to4_prefix $globalipv4)" + if [ $? -ne 0 -o -z "$prefix6to4" ]; then + return 3 + fi + + if [ -z "$globalipv6to4suffix" ]; then + local address6to4="${prefix6to4}::1/16" + else + local address6to4="${prefix6to4}::${globalipv6to4suffix}/16" + fi + + ipv6_add_tunnel_device tun6to4 0.0.0.0 $address6to4 $localipv4 + if [ $? -ne 0 ]; then + local retval=3 + else + local retval=0 + fi + + # Add unspecific unreachable route for local 6to4 address space + /sbin/ip route add unreach ${prefix6to4}::/48 + + # Set MTU, if given + if [ -n "$mtu" ]; then + ipv6_set_mtu $device $mtu + fi + + return $retval +} + + +## Configure all 6to4 tunneling down +# $1: : only "tun6to4" is supported +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_cleanup_6to4_tunnels() { + local fn="ipv6_cleanup_6to4_tunnels" + + local device=$1 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + # Check device + if [ "$device" != "tun6to4" ]; then + net_log $"Given device '$device' is not supported (arg 1)" err $fn + return 1 + fi + + ipv6_test testonly || return 2 + + ipv6_del_tunnel_device tun6to4 + + # Remove all unspecific unreachable routes for local 6to4 address space + /sbin/ip -6 route | LC_ALL=C grep "^unreachable 2002:.*/48 dev lo" | while read token net rest; do + /sbin/ip route del unreach $net + done + + return 0 +} + + +## Configure 6to4 tunneling down +# $1: : only "tun6to4" is supported +# $2: : global address of local interface +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_del_6to4_tunnel() { + local fn="ipv6_del_6to4_tunnel" + + local device=$1 + local localipv4=$2 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + if [ -z "$localipv4" ]; then + net_log $"Missing parameter 'local IPv4 address' (arg 2)" err $fn + return 1 + fi + + # Check device + if [ "$device" != "tun6to4" ]; then + net_log $"Given device '$device' is not supported (arg 1)" err $fn + return 1 + fi + + ipv6_test || return 2 + + ipv6_del_tunnel_device tun6to4 + local retval=$? + + # Remove unspecific unreachable route for local 6to4 address space + /sbin/ip route del unreach ${prefix6to4}::/48 + + return $retval +} + + +## Configure a static tunnel device up +# $1: +# $2: : of foreign tunnel +# $3: [] : local one of a P-t-P tunnel (optional) +# $4: [] : local one of tunnel (optional) +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_add_tunnel_device() { + local fn="ipv6_add_tunnel_device" + + local device=$1 + local addressipv4tunnel=$2 + local addressipv6local=$3 + local addressipv4tunnellocal=$4 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + if [ -z "$addressipv4tunnel" ]; then + net_log $"Missing parameter 'IPv4-tunnel address' (arg 2)" err $fn + return 1 + fi + + if [ -z "$addressipv4tunnellocal" ]; then + local addressipv4tunnellocal="any" + fi + + ipv6_test || return 2 + + if ! ipv6_test_device_status $device; then + local ttldefault="$(/sbin/sysctl -e net.ipv4.ip_default_ttl | awk '{ print $3 }')" + if [ -z "$ttldefault" ]; then + local ttldefault=64 + fi + + # Test whether remote IPv4 address was already applied to another tunnel + if [ "$addressipv4tunnel" != "0.0.0.0" -a "$addressipv4tunnel" != "any" ]; then + /sbin/ip tunnel show remote $addressipv4tunnel 2>/dev/null | LC_ALL=C grep -w "ipv6/ip" | while IFS=":" read devnew rest; do + if [ "$devnew" != "$device" ]; then + net_log $"Given remote address '$addressipv4tunnel' on tunnel device '$device' is already configured on device '$devnew'" err $fn + return 3 + fi + done + fi + + /sbin/ip tunnel add $device mode sit ttl $ttldefault remote $addressipv4tunnel local $addressipv4tunnellocal + if [ $? -ne 0 ]; then + return 3 + fi + + # Test, whether "ip tunnel show" reports valid content + if ! /sbin/ip tunnel show $device 2>/dev/null | LC_ALL=C grep -q -w "remote"; then + net_log $"Tunnel device '$device' creation didn't work" err $fn + return 3 + fi + + /sbin/ip link set $device up + + if ! ipv6_test_device_status $device; then + net_log $"Tunnel device '$device' bringing up didn't work" err $fn + return 3 + fi + + # Set sysctls proper (regardless "default") + /sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.forwarding=1 >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.accept_ra=0 >/dev/null 2>&1 + /sbin/sysctl -e -w net.ipv6.conf.$SYSCTLDEVICE.accept_redirects=0 >/dev/null 2>&1 + + if [ -n "$addressipv6local" ]; then + # Setup P-t-P address + ipv6_add_addr_on_device $device $addressipv6local + if [ $? -ne 0 ]; then + return 3 + fi + fi + else + false + fi + + return 0 +} + + +## Configure a static tunnel device down +# $1: +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_del_tunnel_device() { + local fn="ipv6_del_tunnel_device" + + local device=$1 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + ipv6_test testonly || return 2 + + if ipv6_test_device_status $device; then + ipv6_cleanup_device $device + else + if [ "$device" != "sit0" ]; then + false + fi + fi + + if [ "$device" != "sit0" ]; then + if /sbin/ip tunnel show $device 2>/dev/null | LC_ALL=C grep -q -w "ipv6/ip"; then + /sbin/ip tunnel del $device + + if ipv6_test_device_status $device; then + return 3 + fi + else + false + fi + fi + + return 0 +} + + +## Cleanup all dedicated tunnel devices +ipv6_cleanup_tunnel_devices() { + local fn="ipv6_cleanup_tunnel_devices" + + ipv6_test testonly || return 2 + + # Find still existing tunnel devices and shutdown and delete them + + /sbin/ip tunnel show | awk -F: '/\/ { print $1 }' | while read device; do + ipv6_del_tunnel_device $device + done + + return 0 +} + + +## Get address of a dedicated tunnel +# $1: +# $2: local|remote : local or remote address +# stdout: if available +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_get_ipv4addr_of_tunnel() { + local fn="ipv6_get_local_ipv4_of_tunnel" + + local device=$1 + local selection=$2 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + if [ -z "$selection" ]; then + net_log $"Missing parameter 'selection' (arg 2)" err $fn + return 1 + fi + if [ "$selection" != "local" -a "$selection" != "remote" ]; then + net_log $"Unsupported selection '$selection' specified (arg 2)" err $fn + return 1 + fi + + ipv6_test testonly || return 2 + + ipv6_test_device_status $device + + if [ $? != 0 -a $? != 11 ]; then + # Device doesn't exist + return 3 + fi + + # Device exists, retrieve address + if [ "$selection" = "local" ]; then + local tunnel_local_ipv4addr="$(/sbin/ip tunnel show $device | awk '{ print $6 }')" + elif [ "$selection" = "remote" ]; then + local tunnel_local_ipv4addr="$(/sbin/ip tunnel show $device | awk '{ print $4 }')" + fi + + if [ $? != 0 ]; then + return 3 + fi + + if [ "$tunnel_local_ipv4addr" = "any" ]; then + local tunnel_local_ipv4addr="0.0.0.0" + fi + + echo "$tunnel_local_ipv4addr" + + return 0 +} + + +## Get IPv4 address of a device +# $1: +# stdout: if available +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem (more than one IPv4 address applied) +ipv6_get_ipv4addr_of_device() { + local fn="ipv6_get_ipv4addr_of_device" + + local device=$1 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + ipv6_test_device_status $device + + if [ $? != 0 -a $? != 11 ]; then + # Device doesn't exist + return 3 + fi + + # Device exists, retrieve the first address only + local ipv4addr="$(/sbin/ip -o -4 addr show dev $device | awk '{ print $4 }' | awk -F/ '{ print $1; exit }')" + + if [ $? != 0 ]; then + return 3 + fi + + if [ "$ipv4addr" = "any" ]; then + local ipv4addr="0.0.0.0" + fi + + echo "$ipv4addr" + + return 0 +} + + +## Set IPv6 MTU for a device +# $1: +# $2: +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_set_mtu() { + local fn="ipv6_set_mtu" + + local device=$1 + local ipv6_mtu=$2 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + if [ -z "$ipv6_mtu" ]; then + net_log $"Missing parameter 'IPv6 MTU' (arg 2)" err $fn + return 1 + fi + + # Check range + if [ $ipv6_mtu -lt 1280 -o $ipv6_mtu -gt 65535 ]; then + net_log $"Given IPv6 MTU '$ipv6_mtu' is out of range" err $fn + return 1 + fi + + ipv6_test testonly || return 2 + + # Set value + /sbin/ip link set dev $device mtu $ipv6_mtu + + return 0 +} + + +## Set a default route +# $1: : gateway, can also contain scope suffix (device name), cause a warning if not matching with $2 (but will have precedence) +# $2: : gateway device (optional in case of $1 is a global address or $1 contains scope suffix) +# $3: : (optional) device to check scope and gateway device against (setup is skipped, if not matching) +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_set_default_route() { + local fn="ipv6_set_default_route" + + local address=$1 + local device=$2 + local device_check=$3 + + ipv6_test testonly || return 2 + + # Map the unspecified address to nothing + if [ "$address" = "::" ]; then + local address="" + fi + + if [ -n "$address" ]; then + local addressgw=${address%%%*} + local device_scope=$(echo $address | awk -F% '{ print $2 }') + + if [ -z "$addressgw" ]; then + net_log $"Given IPv6 default gateway '$address' is not in proper format" err $fn + return 3 + fi + + # Scope device has precedence + if [ -n "$device_scope" -a -n "$device" -a "$device_scope" != "$device" ]; then + net_log $"Given IPv6 default gateway '$address' has scope '$device_scope' defined, given default gateway device '$device' will be not used" info $fn + local device="" + fi + + # Link local addresses require a device + if echo $addressgw | LC_ALL=C grep -qi "^fe80:"; then + if [ -z "$device_scope" ]; then + if [ -z "$device" ]; then + net_log $"Given IPv6 default gateway '$address' is link-local, but no scope or gateway device is specified" err $fn + return 3 + fi + fi + fi + + # Check whether the route belongs to the specific given interface + if [ -n "$device_check" ]; then + # Check whether scope device matches given check device + if [ -n "$device_scope" -a "$device_check" != "$device_scope" ]; then + # scope device != specific given -> skip + return 0 + elif [ -n "$device" -a "$device_check" != "$device" ]; then + # gateway device != specific given -> skip + return 0 + fi + fi + + # Set device now, if not given + if [ -z "$device" ]; then + local device="$device_scope" + fi + + if [ -z "$device" ]; then + # Note: this can cause a warning and a not installed route, if given address is not reachable on the link + ipv6_add_route ::/0 $addressgw + else + ipv6_add_route ::/0 $addressgw $device + fi + elif [ -n "$device" ]; then + # Check whether the route belongs to the specific given interface + if [ -n "$device_check" -a "$device_check" != "$device" ]; then + # gateway device != specific given -> skip + return 0 + fi + + ipv6_test_route_requires_next_hop $device + local result=$? + + if [ $result = 0 ]; then + net_log $"Given IPv6 default device '$device' requires an explicit nexthop" err $fn + return 3 + elif [ $result != 10 ]; then + net_log $"Given IPv6 default device '$device' doesn't exist or isn't up" err $fn + return 3 + fi + + ipv6_add_route ::/0 :: $device + else + net_log $"No parameters given to setup a default route" err $fn + return 3 + fi + + return 0 +} + + +## Resolve need of explicit next hop for an interface +# $1: +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem 10=needs no explicit hop +ipv6_test_route_requires_next_hop() { + local fn="ipv6_test_route_requires_next_hop" + + local device=$1 + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + ipv6_test testonly || return 2 + + ipv6_test_device_status $device + + if [ $? != 0 ]; then + return 3 + fi + + if [ "$device" = "sit0" ]; then + return 10 + fi + + if /sbin/ip -o link show $device 2>/dev/null | LC_ALL=C grep -q "POINTOPOINT"; then + return 10 + fi + + return 0 +} + + +## Trigger radvd +# $1: up|down : device reason for triggering (coming up or going down) +# $2: [startstop|restart|reload|SIGHUP] : triger mechanism (default is "SIGHUP") +# "startstop" : reason=up -> start, reason=down -> stop +# $3: [] : alternative pid file [optional] +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem +ipv6_trigger_radvd() { + local fn="ipv6_trigger_radvd" + + local reason=$1 + local mechanism=$2 + local pidfile=$3 + + if [ -z "$reason" ]; then + net_log $"No reason given for sending trigger to radvd" err $fn + return 1 + fi + + if [ "$reason" != "up" -a "$reason" != "down" ]; then + net_log $"Unsupported reason '$reason' for sending trigger to radvd" err $fn + return 1 + fi + + if [ -z "$mechanism" ]; then + # Take default + local mechanism="SIGHUP" + fi + + if [ -z "$pidfile" ]; then + local pidfile="/run/radvd/radvd.pid" + fi + + # Print message and select action + case $mechanism in + 'startstop') + case $reason in + up) + local action="start" + ;; + down) + local action="stop" + ;; + esac + ;; + 'reload'|'restart'|'SIGHUP') + local action="$mechanism" + ;; + *) + net_log $"Unsupported mechanism '$mechanism' for sending trigger to radvd" err $fn + return 3 + ;; + esac + + # PID file needed? + if [ "$action" = "SIGHUP" ]; then + if ! [ -f "$pidfile" ]; then + if [ "$reason" = "down" ]; then + # be quiet because triggering may have been disabled + true + else + net_log $"Given pidfile '$pidfile' doesn't exist, cannot send trigger to radvd" err $fn + fi + return 3 + fi + + # Get PID + local pid="$(cat $pidfile)" + if [ -z "$pid" ]; then + # pidfile empty - strange + net_log $"Pidfile '$pidfile' is empty, cannot send trigger to radvd" err $fn + return 3 + fi + fi + + + # Do action + case $action in + 'SIGHUP') + kill -HUP $pid + ;; + 'reload'|'restart'|'stop'|'start') + if ! /sbin/chkconfig --list radvd >/dev/null 2>&1; then + if [ "$reason" = "down" ]; then + # be quiet because triggering may have been disabled + true + else + net_log $"radvd not (properly) installed, triggering failed" err $fn + fi + return 3 + else + /sbin/service radvd $action >/dev/null 2>&1 + fi + ;; + *) + # Normally not reached, "action" is set above to proper value + ;; + esac + + return 0 +} + +#https://www.vaspects.com/2013/12/11/services-dont-bind-to-ipv6-address/ +ipv6_wait_tentative() { + local fn="ipv6_wait_tentative" + local device=$1 + local countdown=30 + local ip_output="" + + if [ -z "$device" ]; then + net_log $"Missing parameter 'device' (arg 1)" err $fn + return 1 + fi + + [ "$device" = lo ] && return 0 + + while [ ${countdown} -gt 0 ]; do + ip_output="$(ip -6 addr show dev ${device} scope global tentative)" + + if [ -z "$ip_output" ]; then + return 0; + elif echo "$ip_output" | grep "dadfailed" > /dev/null; then + net_log $"Duplicate Address Detection: Duplicate addresses detected" err $fn + net_log $"Duplicate Address Detection: Please, fix your network configuration" err $fn + return 1 + fi + + net_log $"Waiting for interface ${device} IPv6 address(es) to leave the 'tentative' state" info $fn + sleep 1 + countdown=$(($countdown - 1)) + done + + ip_output="$(ip -6 addr show dev ${device} scope global tentative)" + + if [ -n "$ip_output" ]; then + net_log $"Some IPv6 address(es) of ${device} remain still in 'tentative' state" warning $fn + net_log $"Run 'ip -6 addr show dev ${device} scope global tentative' to see more" warning $fn + fi + + return 0 +} diff --git a/networks b/networks deleted file mode 100644 index 9a46fc80..00000000 --- a/networks +++ /dev/null @@ -1,3 +0,0 @@ -default 0.0.0.0 -loopback 127.0.0.0 -link-local 169.254.0.0 diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions deleted file mode 100644 index a8174751..00000000 --- a/rc.d/init.d/functions +++ /dev/null @@ -1,721 +0,0 @@ -# -*-Shell-script-*- -# -# functions This file contains functions to be used by most or all -# shell scripts in the /etc/init.d directory. -# - -TEXTDOMAIN=initscripts - -# Make sure umask is sane -umask 022 - -# Set up a default search path. -PATH="/sbin:/usr/sbin:/bin:/usr/bin" -export PATH - -if [ $PPID -ne 1 -a -z "$SYSTEMCTL_SKIP_REDIRECT" ] && \ - [ -d /run/systemd/system ] ; then - case "$0" in - /etc/init.d/*|/etc/rc.d/init.d/*) - _use_systemctl=1 - ;; - esac -fi - -systemctl_redirect () { - local s - local prog=${1##*/} - local command=$2 - local options="" - - case "$command" in - start) - s=$"Starting $prog (via systemctl): " - ;; - stop) - s=$"Stopping $prog (via systemctl): " - ;; - reload|try-reload) - s=$"Reloading $prog configuration (via systemctl): " - ;; - restart|try-restart|condrestart) - s=$"Restarting $prog (via systemctl): " - ;; - esac - - if [ -n "$SYSTEMCTL_IGNORE_DEPENDENCIES" ] ; then - options="--ignore-dependencies" - fi - - if ! systemctl show "$prog.service" > /dev/null 2>&1 || \ - systemctl show -p LoadState "$prog.service" | grep -q 'not-found' ; then - action $"Reloading systemd: " /bin/systemctl daemon-reload - fi - - action "$s" /bin/systemctl $options $command "$prog.service" -} - -# Get a sane screen width -[ -z "${COLUMNS:-}" ] && COLUMNS=80 - -if [ -z "${CONSOLETYPE:-}" ]; then - if [ -c "/dev/stderr" ] && [ -r "/dev/stderr" ]; then - CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)" - else - CONSOLETYPE="serial" - fi -fi - -if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && \ - [ -f /etc/sysconfig/i18n -o -f /etc/locale.conf ] ; then - . /etc/profile.d/lang.sh 2>/dev/null - # avoid propagating LANGSH_SOURCED any further - unset LANGSH_SOURCED -fi - -# Read in our configuration -if [ -z "${BOOTUP:-}" ]; then - if [ -f /etc/sysconfig/init ]; then - . /etc/sysconfig/init - else - # verbose ->> very (very!) old bootup look (prior to RHL-6.0?) - # color ->> default bootup look - # other ->> default bootup look without ANSI colors or positioning - BOOTUP=color - # Column to start "[ OK ]" label in: - RES_COL=60 - # terminal sequence to move to that column: - MOVE_TO_COL="echo -en \\033[${RES_COL}G" - # Terminal sequence to set color to a 'success' (bright green): - SETCOLOR_SUCCESS="echo -en \\033[1;32m" - # Terminal sequence to set color to a 'failure' (bright red): - SETCOLOR_FAILURE="echo -en \\033[1;31m" - # Terminal sequence to set color to a 'warning' (bright yellow): - SETCOLOR_WARNING="echo -en \\033[1;33m" - # Terminal sequence to reset to the default color: - SETCOLOR_NORMAL="echo -en \\033[0;39m" - - # Verbosity of logging: - LOGLEVEL=1 - fi - if [ "$CONSOLETYPE" = "serial" ]; then - BOOTUP=serial - MOVE_TO_COL= - SETCOLOR_SUCCESS= - SETCOLOR_FAILURE= - SETCOLOR_WARNING= - SETCOLOR_NORMAL= - fi -fi - -# Check if any of $pid (could be plural) are running -checkpid() { - local i - - for i in $* ; do - [ -d "/proc/$i" ] && return 0 - done - return 1 -} - -__kill_pids_term_kill_checkpids() { - local base_stime=$1 - shift 1 - local pid= - local pids=$* - local remaining= - local stat= - local stime= - - for pid in $pids ; do - [ ! -e "/proc/$pid" ] && continue - read -r line < "/proc/$pid/stat" 2> /dev/null - - stat=($line) - stime=${stat[21]} - - [ -n "$stime" ] && [ "$base_stime" -lt "$stime" ] && continue - remaining+="$pid " - done - - echo "$remaining" - [ -n "$remaining" ] && return 1 - - return 0 -} - -__kill_pids_term_kill() { - local try=0 - local delay=3; - local pid= - local stat= - local base_stime= - - # We can't initialize stat & base_stime on the same line where 'local' - # keyword is, otherwise the sourcing of this file will fail for ksh... - stat=($(< /proc/self/stat)) - base_stime=${stat[21]} - - if [ "$1" = "-d" ]; then - delay=$2 - shift 2 - fi - - local kill_list=$* - - kill_list=$(__kill_pids_term_kill_checkpids $base_stime $kill_list) - - [ -z "$kill_list" ] && return 0 - - kill -TERM $kill_list >/dev/null 2>&1 - sleep 0.1 - - kill_list=$(__kill_pids_term_kill_checkpids $base_stime $kill_list) - if [ -n "$kill_list" ] ; then - while [ $try -lt $delay ] ; do - sleep 1 - kill_list=$(__kill_pids_term_kill_checkpids $base_stime $kill_list) - [ -z "$kill_list" ] && break - let try+=1 - done - if [ -n "$kill_list" ] ; then - kill -KILL $kill_list >/dev/null 2>&1 - sleep 0.1 - kill_list=$(__kill_pids_term_kill_checkpids $base_stime $kill_list) - fi - fi - - [ -n "$kill_list" ] && return 1 - return 0 -} - -# __proc_pids {program} [pidfile] -# Set $pid to pids from /run* for {program}. $pid should be declared -# local in the caller. -# Returns LSB exit code for the 'status' action. -__pids_var_run() { - local base=${1##*/} - local pid_file=${2:-/run/$base.pid} - local pid_dir=$(/usr/bin/dirname $pid_file > /dev/null) - local binary=$3 - - [ -d "$pid_dir" ] && [ ! -r "$pid_dir" ] && return 4 - - pid= - if [ -f "$pid_file" ] ; then - local line p - - [ ! -r "$pid_file" ] && return 4 # "user had insufficient privilege" - while : ; do - read line - [ -z "$line" ] && break - for p in $line ; do - if [ -z "${p//[0-9]/}" ] && [ -d "/proc/$p" ] ; then - if [ -n "$binary" ] ; then - local b=$(readlink /proc/$p/exe | sed -e 's/\s*(deleted)$//') - [ "$b" != "$binary" ] && continue - fi - pid="$pid $p" - fi - done - done < "$pid_file" - - if [ -n "$pid" ]; then - return 0 - fi - return 1 # "Program is dead and /run pid file exists" - fi - return 3 # "Program is not running" -} - -# Output PIDs of matching processes, found using pidof -__pids_pidof() { - pidof -c -m -o $$ -o $PPID -o %PPID -x "$1" || \ - pidof -c -m -o $$ -o $PPID -o %PPID -x "${1##*/}" -} - - -# A function to start a program. -daemon() { - # Test syntax. - local gotbase= force= nicelevel corelimit - local pid base= user= nice= bg= pid_file= - local cgroup= - nicelevel=0 - while [ "$1" != "${1##[-+]}" ]; do - case $1 in - '') - echo $"$0: Usage: daemon [+/-nicelevel] {program}" "[arg1]..." - return 1 - ;; - --check) - base=$2 - gotbase="yes" - shift 2 - ;; - --check=?*) - base=${1#--check=} - gotbase="yes" - shift - ;; - --user) - user=$2 - shift 2 - ;; - --user=?*) - user=${1#--user=} - shift - ;; - --pidfile) - pid_file=$2 - shift 2 - ;; - --pidfile=?*) - pid_file=${1#--pidfile=} - shift - ;; - --force) - force="force" - shift - ;; - [-+][0-9]*) - nice="nice -n $1" - shift - ;; - *) - echo $"$0: Usage: daemon [+/-nicelevel] {program}" "[arg1]..." - return 1 - ;; - esac - done - - # Save basename. - [ -z "$gotbase" ] && base=${1##*/} - - # See if it's already running. Look *only* at the pid file. - __pids_var_run "$base" "$pid_file" - - [ -n "$pid" -a -z "$force" ] && return - - # make sure it doesn't core dump anywhere unless requested - corelimit="ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0}" - - # if they set NICELEVEL in /etc/sysconfig/foo, honor it - [ -n "${NICELEVEL:-}" ] && nice="nice -n $NICELEVEL" - - # if they set CGROUP_DAEMON in /etc/sysconfig/foo, honor it - if [ -n "${CGROUP_DAEMON}" ]; then - if [ ! -x /bin/cgexec ]; then - echo -n "Cgroups not installed"; warning - echo - else - cgroup="/bin/cgexec"; - for i in $CGROUP_DAEMON; do - cgroup="$cgroup -g $i"; - done - fi - fi - - # Echo daemon - [ "${BOOTUP:-}" = "verbose" -a -z "${LSB:-}" ] && echo -n " $base" - - # And start it up. - if [ -z "$user" ]; then - $cgroup $nice /bin/bash -c "$corelimit >/dev/null 2>&1 ; $*" - else - $cgroup $nice runuser -s /bin/bash $user -c "$corelimit >/dev/null 2>&1 ; $*" - fi - - [ "$?" -eq 0 ] && success $"$base startup" || failure $"$base startup" -} - -# A function to stop a program. -killproc() { - local RC killlevel= base pid pid_file= delay try binary= - - RC=0; delay=3; try=0 - # Test syntax. - if [ "$#" -eq 0 ]; then - echo $"Usage: killproc [-p pidfile] [ -d delay] {program} [-signal]" - return 1 - fi - if [ "$1" = "-p" ]; then - pid_file=$2 - shift 2 - fi - if [ "$1" = "-b" ]; then - if [ -z $pid_file ]; then - echo $"-b option can be used only with -p" - echo $"Usage: killproc -p pidfile -b binary program" - return 1 - fi - binary=$2 - shift 2 - fi - if [ "$1" = "-d" ]; then - delay=$(echo $2 | awk -v RS=' ' -v IGNORECASE=1 '{if($1!~/^[0-9.]+[smhd]?$/) exit 1;d=$1~/s$|^[0-9.]*$/?1:$1~/m$/?60:$1~/h$/?60*60:$1~/d$/?24*60*60:-1;if(d==-1) exit 1;delay+=d*$1} END {printf("%d",delay+0.5)}') - if [ "$?" -eq 1 ]; then - echo $"Usage: killproc [-p pidfile] [ -d delay] {program} [-signal]" - return 1 - fi - shift 2 - fi - - - # check for second arg to be kill level - [ -n "${2:-}" ] && killlevel=$2 - - # Save basename. - base=${1##*/} - - # Find pid. - __pids_var_run "$1" "$pid_file" "$binary" - RC=$? - if [ -z "$pid" ]; then - if [ -z "$pid_file" ]; then - pid="$(__pids_pidof "$1")" - else - [ "$RC" = "4" ] && { failure $"$base shutdown" ; return $RC ;} - fi - fi - - # Kill it. - if [ -n "$pid" ] ; then - [ "$BOOTUP" = "verbose" -a -z "${LSB:-}" ] && echo -n "$base " - if [ -z "$killlevel" ] ; then - __kill_pids_term_kill -d $delay $pid - RC=$? - [ "$RC" -eq 0 ] && success $"$base shutdown" || failure $"$base shutdown" - # use specified level only - else - if checkpid $pid; then - kill $killlevel $pid >/dev/null 2>&1 - RC=$? - [ "$RC" -eq 0 ] && success $"$base $killlevel" || failure $"$base $killlevel" - elif [ -n "${LSB:-}" ]; then - RC=7 # Program is not running - fi - fi - else - if [ -n "${LSB:-}" -a -n "$killlevel" ]; then - RC=7 # Program is not running - else - failure $"$base shutdown" - RC=0 - fi - fi - - # Remove pid file if any. - if [ -z "$killlevel" ]; then - rm -f "${pid_file:-/run/$base.pid}" - fi - return $RC -} - -# A function to find the pid of a program. Looks *only* at the pidfile -pidfileofproc() { - local pid - - # Test syntax. - if [ "$#" = 0 ] ; then - echo $"Usage: pidfileofproc {program}" - return 1 - fi - - __pids_var_run "$1" - [ -n "$pid" ] && echo $pid - return 0 -} - -# A function to find the pid of a program. -pidofproc() { - local RC pid pid_file= - - # Test syntax. - if [ "$#" = 0 ]; then - echo $"Usage: pidofproc [-p pidfile] {program}" - return 1 - fi - if [ "$1" = "-p" ]; then - pid_file=$2 - shift 2 - fi - fail_code=3 # "Program is not running" - - # First try "/run/*.pid" files - __pids_var_run "$1" "$pid_file" - RC=$? - if [ -n "$pid" ]; then - echo $pid - return 0 - fi - - [ -n "$pid_file" ] && return $RC - __pids_pidof "$1" || return $RC -} - -status() { - local base pid lock_file= pid_file= binary= - - # Test syntax. - if [ "$#" = 0 ] ; then - echo $"Usage: status [-p pidfile] {program}" - return 1 - fi - if [ "$1" = "-p" ]; then - pid_file=$2 - shift 2 - fi - if [ "$1" = "-l" ]; then - lock_file=$2 - shift 2 - fi - if [ "$1" = "-b" ]; then - if [ -z $pid_file ]; then - echo $"-b option can be used only with -p" - echo $"Usage: status -p pidfile -b binary program" - return 1 - fi - binary=$2 - shift 2 - fi - base=${1##*/} - - if [ "$_use_systemctl" = "1" ]; then - systemctl status ${0##*/}.service - ret=$? - # LSB daemons that dies abnormally in systemd looks alive in systemd's eyes due to RemainAfterExit=yes - # lets adjust the reality a little bit - if systemctl show -p ActiveState ${0##*/}.service | grep -q '=active$' && \ - systemctl show -p SubState ${0##*/}.service | grep -q '=exited$' ; then - ret=3 - fi - return $ret - fi - - # First try "pidof" - __pids_var_run "$1" "$pid_file" "$binary" - RC=$? - if [ -z "$pid_file" -a -z "$pid" ]; then - pid="$(__pids_pidof "$1")" - fi - if [ -n "$pid" ]; then - echo $"${base} (pid $pid) is running..." - return 0 - fi - - case "$RC" in - 0) - echo $"${base} (pid $pid) is running..." - return 0 - ;; - 1) - echo $"${base} dead but pid file exists" - return 1 - ;; - 4) - echo $"${base} status unknown due to insufficient privileges." - return 4 - ;; - esac - if [ -z "${lock_file}" ]; then - lock_file=${base} - fi - # See if /var/lock/subsys/${lock_file} exists - if [ -f /var/lock/subsys/${lock_file} ]; then - echo $"${base} dead but subsys locked" - return 2 - fi - echo $"${base} is stopped" - return 3 -} - -echo_success() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS - echo -n $" OK " - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 0 -} - -echo_failure() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE - echo -n $"FAILED" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 1 -} - -echo_passed() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING - echo -n $"PASSED" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 1 -} - -echo_warning() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING - echo -n $"WARNING" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 1 -} - -# Inform the graphical boot of our current state -update_boot_stage() { - if [ -x /bin/plymouth ]; then - /bin/plymouth --update="$1" - fi - return 0 -} - -# Log that something succeeded -success() { - [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_success - return 0 -} - -# Log that something failed -failure() { - local rc=$? - [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_failure - [ -x /bin/plymouth ] && /bin/plymouth --details - return $rc -} - -# Log that something passed, but may have had errors. Useful for fsck -passed() { - local rc=$? - [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_passed - return $rc -} - -# Log a warning -warning() { - local rc=$? - [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_warning - return $rc -} - -# Run some action. Log its output. -action() { - local STRING rc - - STRING=$1 - echo -n "$STRING " - shift - "$@" && success $"$STRING" || failure $"$STRING" - rc=$? - echo - return $rc -} - -# returns OK if $1 contains $2 -strstr() { - [ "${1#*$2*}" = "$1" ] && return 1 - return 0 -} - -# Check whether file $1 is a backup or rpm-generated file and should be ignored -is_ignored_file() { - case "$1" in - *~ | *.bak | *.old | *.orig | *.rpmnew | *.rpmorig | *.rpmsave) - return 0 - ;; - esac - return 1 -} - -# Convert the value ${1} of time unit ${2}-seconds into seconds: -convert2sec() { - local retval="" - - case "${2}" in - deci) retval=$(awk "BEGIN {printf \"%.1f\", ${1} / 10}") ;; - centi) retval=$(awk "BEGIN {printf \"%.2f\", ${1} / 100}") ;; - mili) retval=$(awk "BEGIN {printf \"%.3f\", ${1} / 1000}") ;; - micro) retval=$(awk "BEGIN {printf \"%.6f\", ${1} / 1000000}") ;; - nano) retval=$(awk "BEGIN {printf \"%.9f\", ${1} / 1000000000}") ;; - piko) retval=$(awk "BEGIN {printf \"%.12f\", ${1} / 1000000000000}") ;; - esac - - echo "${retval}" -} - -# Evaluate shvar-style booleans -is_true() { - case "$1" in - [tT] | [yY] | [yY][eE][sS] | [oO][nN] | [tT][rR][uU][eE] | 1) - return 0 - ;; - esac - return 1 -} - -# Evaluate shvar-style booleans -is_false() { - case "$1" in - [fF] | [nN] | [nN][oO] | [oO][fF][fF] | [fF][aA][lL][sS][eE] | 0) - return 0 - ;; - esac - return 1 -} - -# Apply sysctl settings, including files in /etc/sysctl.d -apply_sysctl() { - if [ -x /lib/systemd/systemd-sysctl ]; then - /lib/systemd/systemd-sysctl - else - for file in /usr/lib/sysctl.d/*.conf ; do - is_ignored_file "$file" && continue - [ -f /run/sysctl.d/${file##*/} ] && continue - [ -f /etc/sysctl.d/${file##*/} ] && continue - test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 - done - for file in /run/sysctl.d/*.conf ; do - is_ignored_file "$file" && continue - [ -f /etc/sysctl.d/${file##*/} ] && continue - test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 - done - for file in /etc/sysctl.d/*.conf ; do - is_ignored_file "$file" && continue - test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 - done - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 - fi -} - -# A sed expression to filter out the files that is_ignored_file recognizes -__sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' - -if [ "$_use_systemctl" = "1" ]; then - if [ "x$1" = xstart -o \ - "x$1" = xstop -o \ - "x$1" = xrestart -o \ - "x$1" = xreload -o \ - "x$1" = xtry-restart -o \ - "x$1" = xforce-reload -o \ - "x$1" = xcondrestart ] ; then - - systemctl_redirect $0 $1 - exit $? - fi -fi - -strstr "$(cat /proc/cmdline)" "rc.debug" && set -x -return 0 - diff --git a/rc.d/init.d/netconsole b/rc.d/init.d/netconsole deleted file mode 100644 index 3f2872dd..00000000 --- a/rc.d/init.d/netconsole +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/bash -# -# netconsole This loads the netconsole module with the configured parameters. -# -# chkconfig: - 50 50 -# description: Initializes network console logging -# config: /etc/sysconfig/netconsole -# -### BEGIN INIT INFO -# Provides: netconsole -# Required-Start: $network -# Short-Description: Initializes network console logging -# Description: Initializes network console logging of kernel messages. -### END INIT INFO - -# Copyright 2002 Red Hat, Inc. -# -# Based in part on a shell script by -# Andreas Dilger Sep 26, 2001 - -PATH=/sbin:/usr/sbin:$PATH -RETVAL=0 -SERVER_ADDRESS_RESOLUTION= - -# Check that networking is up. -. /etc/sysconfig/network - -# Source function library. -. /etc/rc.d/init.d/functions - -# Default values -LOCALPORT=6666 -DEV= - -SYSLOGADDR= -SYSLOGPORT=514 -SYSLOGMACADDR= - -kernel=$(uname -r | cut -d. -f1-2) - -usage () -{ - echo $"Usage: $0 {start|stop|status|restart|condrestart}" 1>&2 - RETVAL=2 -} - -print_address_info () -{ - local host=$1 - local route via target - - route=$(LANG=C ip -o route get to $host/32) - - [ -z "$DEV" ] && DEV=$(echo $route | sed "s|.* dev \([^ ]*\).*|\1|") - echo "DEV=$DEV" - echo "LOCALADDR=$(echo $route | sed "s|.* src \([^ ]*\).*|\1|")" - if [[ $route == *" via "* ]] ; then - via=$(echo $route | sed "s|.* via \([^ ]*\).*|\1|") - target=$via - else - target=$host - fi - if [ -z "$SYSLOGMACADDR" ]; then - arp=$(LANG=C /sbin/arping -f -c 1 -I $DEV $target 2>/dev/null | awk '/ reply from .*[.*]/ { print gensub(".* reply from .* \\[(.*)\\].*","\\1","G"); exit }') - [ -n "$arp" ] && echo "SYSLOGMACADDR=$arp" - fi -} - -start () -{ - [ -f /etc/sysconfig/netconsole ] || exit 6 - . /etc/sysconfig/netconsole - - SYSLOGOPTS= - # syslogd server, if any - if [ -n "$SYSLOGADDR" ]; then - # IPv6 regex also covers 4to6, zero-compressed, and link-local addresses with zone-index addresses. - # It should also cover IPv4-embedded, IPv4-mapped, and IPv4-translated IPv6 addresses. - # Taken from: http://stackoverflow.com/a/17871737/3481531 - IPv4_regex="^([0-9]{1,3}\.){3}[0-9]{1,3}$" - IPv6_regex="^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$" - if ! [[ "$SYSLOGADDR" =~ $IPv4_regex ]] && ! [[ "$SYSLOGADDR" =~ $IPv6_regex ]]; then - # Use IPv4 by default: - SYSLOGADDR="$(LANG=C getent ahostsv4 $SYSLOGADDR 2> /dev/null)" - - # Try IPv6 in case IPv4 resolution has failed: - if [[ $? -eq 2 ]]; then - SYSLOGADDR="$(LANG=C getent ahostsv6 $SYSLOGADDR 2> /dev/null)" - fi - - if [[ $? -ne 0 ]]; then - echo $"Unable to resolve IP address specified in /etc/sysconfig/netconsole" 1>&2 - exit 6 - fi - - SYSLOGADDR="$(echo "$SYSLOGADDR" | head -1 | cut --delimiter=' ' --fields=1)" - fi - fi - if [ -z "$SYSLOGADDR" ] ; then - echo $"Server address not specified in /etc/sysconfig/netconsole" 1>&2 - exit 6 - fi - eval $(print_address_info $SYSLOGADDR) - - if [ -z "$SYSLOGMACADDR" ]; then - echo $"netconsole: can't resolve MAC address of $SYSLOGADDR" 1>&2 - exit 1 - fi - - SYSLOGOPTS="netconsole=$LOCALPORT@$LOCALADDR/$DEV,$SYSLOGPORT@$SYSLOGADDR/$SYSLOGMACADDR " - - /usr/bin/logger -p daemon.info -t netconsole: inserting netconsole module with arguments \ - $SYSLOGOPTS - if [ -n "$SYSLOGOPTS" ]; then - action $"Initializing netconsole" modprobe netconsole \ - $SYSLOGOPTS - [ "$?" != "0" ] && RETVAL=1 - fi - touch /var/lock/subsys/netconsole -} - -stop () -{ - if /sbin/lsmod | grep netconsole >/dev/null 2>&1 ; then - action $"Disabling netconsole" rmmod netconsole; - [ "$?" != "0" ] && RETVAL=1 - fi - - rm -f /var/lock/subsys/netconsole -} - -status () -{ - if /sbin/lsmod | grep netconsole >/dev/null 2>&1 ; then - echo $"netconsole module loaded" - RETVAL=0 - else - echo $"netconsole module not loaded" - RETVAL=3 - fi -} - - -restart () -{ - stop - start -} - -condrestart () -{ - [ -e /var/lock/subsys/netconsole ] && restart -} - - -case "$1" in - stop) stop ;; - status) status ;; - start|restart|reload|force-reload) restart ;; - condrestart) condrestart ;; - *) usage ;; -esac - -exit $RETVAL diff --git a/rc.d/init.d/network b/rc.d/init.d/network deleted file mode 100755 index 52b2d6b9..00000000 --- a/rc.d/init.d/network +++ /dev/null @@ -1,259 +0,0 @@ -#! /bin/bash -# -# network Bring up/down networking -# -# chkconfig: - 10 90 -# description: Activates/Deactivates all network interfaces configured to \ -# start at boot time. -# -### BEGIN INIT INFO -# Provides: $network -# Should-Start: iptables ip6tables NetworkManager-wait-online NetworkManager $network-pre -# Short-Description: Bring up/down networking -# Description: Bring up/down networking -### END INIT INFO - -# Source function library. -. /etc/init.d/functions - -if [ ! -f /etc/sysconfig/network ]; then - exit 6 -fi - -. /etc/sysconfig/network - -if [ -f /etc/sysconfig/pcmcia ]; then - . /etc/sysconfig/pcmcia -fi - - -# Check that networking is up. -[ "${NETWORKING}" = "no" ] && exit 6 - -# if the ip configuration utility isn't around we can't function. -[ -x /sbin/ip ] || exit 1 - - -CWD=$(pwd) -cd /etc/sysconfig/network-scripts - -. ./network-functions - -# find all the interfaces besides loopback. -# ignore aliases, alternative configurations, and editor backup files -interfaces=$(ls ifcfg-* | \ - LC_ALL=C sed -e "$__sed_discard_ignored_files" \ - -e '/\(ifcfg-lo$\|:\|ifcfg-.*-range\)/d' \ - -e '{ s/^ifcfg-//g;s/[0-9]/ &/}' | \ - LC_ALL=C sort -k 1,1 -k 2n | \ - LC_ALL=C sed 's/ //') -rc=0 - -# See how we were called. -case "$1" in -start) - [ "$EUID" != "0" ] && exit 4 - rc=0 - # IPv6 hook (pre IPv4 start) - if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then - /etc/sysconfig/network-scripts/init.ipv6-global start pre - fi - - apply_sysctl - - #tell NM to reload its configuration - if [ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" = "running" ]; then - nmcli connection reload - fi - - # bring up loopback interface - action $"Bringing up loopback interface: " ./ifup ifcfg-lo - - case "$VLAN" in - yes) - if [ ! -d /proc/net/vlan ] && ! modprobe 8021q >/dev/null 2>&1 ; then - net_log $"No 802.1Q VLAN support available in kernel." - fi - ;; - esac - - vlaninterfaces="" - vpninterfaces="" - xdslinterfaces="" - bridgeinterfaces="" - - # bring up all other interfaces configured to come up at boot time - for i in $interfaces; do - unset DEVICE TYPE SLAVE NM_CONTROLLED - eval $(LANG=C grep -F "DEVICE=" ifcfg-$i) - eval $(LANG=C grep -F "TYPE=" ifcfg-$i) - eval $(LANG=C grep -F "SLAVE=" ifcfg-$i) - eval $(LANG=C grep -F "NM_CONTROLLED=" ifcfg-$i) - - if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi - - if [ "$SLAVE" = "yes" ] && ( ! is_nm_running || is_false $NM_CONTROLLED ) ; then - continue - fi - - if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then - vpninterfaces="$vpninterfaces $i" - continue - fi - if [ "$TYPE" = "xDSL" -o "$TYPE" = "Modem" ]; then - xdslinterfaces="$xdslinterfaces $i" - continue - fi - - if [ "$TYPE" = "Bridge" ]; then - bridgeinterfaces="$bridgeinterfaces $i" - continue - fi - if [ "$TYPE" = "IPSEC" ] || [ "$TYPE" = "IPIP" ] || [ "$TYPE" = "GRE" ]; then - vpninterfaces="$vpninterfaces $i" - continue - fi - - if [ "${DEVICE%%.*}" != "$DEVICE" -o "${DEVICE##vlan}" != "$DEVICE" ] ; then - vlaninterfaces="$vlaninterfaces $i" - continue - fi - - if LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then - # this loads the module, to preserve ordering - is_available $i - continue - fi - action $"Bringing up interface $i: " ./ifup $i boot - [ $? -ne 0 ] && rc=1 - done - - # Bring up xDSL and VPN interfaces - for i in $vlaninterfaces $bridgeinterfaces $xdslinterfaces $vpninterfaces ; do - if ! LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i >/dev/null 2>&1 ; then - action $"Bringing up interface $i: " ./ifup $i boot - [ $? -ne 0 ] && rc=1 - fi - done - - # Add non interface-specific static-routes. - if [ -f /etc/sysconfig/static-routes ]; then - if [ -x /sbin/route ]; then - grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do - /sbin/route add -$args - done - else - net_log $"Legacy static-route support not available: /sbin/route not found" - fi - fi - - # IPv6 hook (post IPv4 start) - if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then - /etc/sysconfig/network-scripts/init.ipv6-global start post - fi - # Run this again to catch any interface-specific actions - apply_sysctl - - touch /var/lock/subsys/network - - [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} - ;; -stop) - [ "$EUID" != "0" ] && exit 4 - # Don't shut the network down if root or /usr is on NFS or a network - # block device. - if systemctl show --property=RequiredBy -- -.mount usr.mount | grep -q 'remote-fs.target' ; then - net_log $"rootfs or /usr is on network filesystem, leaving network up" - exit 1 - fi - - # Don't shut the network down when shutting down the system if configured - # as such in sysconfig - if is_false "$IFDOWN_ON_SHUTDOWN"; then - if systemctl is-system-running | grep -q 'stopping'; then - net_log $"system is shutting down, leaving interfaces up as requested" - exit 1 - fi - fi - - vlaninterfaces="" - vpninterfaces="" - xdslinterfaces="" - bridgeinterfaces="" - remaining="" - rc=0 - - # get list of bonding, vpn, and xdsl interfaces - for i in $interfaces; do - unset DEVICE TYPE - eval $(LANG=C grep -F "DEVICE=" ifcfg-$i) - eval $(LANG=C grep -F "TYPE=" ifcfg-$i) - - if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi - - if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then - vpninterfaces="$vpninterfaces $i" - continue - fi - if [ "$TYPE" = "IPSEC" ] || [ "$TYPE" = "IPIP" ] || [ "$TYPE" = "GRE" ]; then - vpninterfaces="$vpninterfaces $i" - continue - fi - if [ "$TYPE" = "Bridge" ]; then - bridgeinterfaces="$bridgeinterfaces $i" - continue - fi - if [ "$TYPE" = "xDSL" -o "$TYPE" = "Modem" ]; then - xdslinterfaces="$xdslinterfaces $i" - continue - fi - - if [ "${DEVICE%%.*}" != "$DEVICE" -o "${DEVICE##vlan}" != "$DEVICE" ] ; then - vlaninterfaces="$vlaninterfaces $i" - continue - fi - remaining="$remaining $i" - done - - for i in $vpninterfaces $xdslinterfaces $bridgeinterfaces $vlaninterfaces $remaining; do - unset DEVICE TYPE - (. ./ifcfg-$i - if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi - - if ! check_device_down $DEVICE; then - action $"Shutting down interface $i: " ./ifdown $i boot - [ $? -ne 0 ] && rc=1 - fi - ) - done - - action $"Shutting down loopback interface: " ./ifdown ifcfg-lo - - sysctl -w net.ipv4.ip_forward=0 > /dev/null 2>&1 - - # IPv6 hook (post IPv4 stop) - if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then - /etc/sysconfig/network-scripts/init.ipv6-global stop post - fi - - rm -f /var/lock/subsys/network - ;; -status) - echo $"Configured devices:" - echo lo $interfaces - - echo $"Currently active devices:" - echo $(/sbin/ip -o link show up | awk -F ": " '{ print $2 }') - ;; -restart|force-reload) - cd "$CWD" - $0 stop - $0 start - rc=$? - ;; -*) - echo $"Usage: $0 {start|stop|status|restart|force-reload}" - exit 2 -esac - -exit $rc diff --git a/rwtab b/rwtab deleted file mode 100644 index ef574664..00000000 --- a/rwtab +++ /dev/null @@ -1,45 +0,0 @@ -dirs /var/cache/man -dirs /var/gdm -dirs /var/lib/xkb -dirs /var/log -dirs /var/lib/puppet -dirs /var/lib/dbus - -empty /tmp -empty /var/cache/foomatic -empty /var/cache/logwatch -empty /var/cache/httpd/ssl -empty /var/cache/httpd/proxy -empty /var/cache/php-pear -empty /var/cache/systemtap -empty /var/db/nscd -empty /var/lib/dav -empty /var/lib/dhcpd -empty /var/lib/dhclient -empty /var/lib/php -empty /var/lib/pulse -empty /var/lib/systemd/timers -empty /var/lib/ups -empty /var/tmp - -files /etc/adjtime -files /etc/ntp.conf -files /etc/resolv.conf -files /etc/lvm/cache -files /etc/lvm/archive -files /etc/lvm/backup -files /var/account -files /var/lib/arpwatch -files /var/lib/NetworkManager -files /var/cache/alchemist -files /var/lib/gdm -files /var/lib/iscsi -files /var/lib/logrotate.status -files /var/lib/ntp -files /var/lib/xen -files /var/empty/sshd/etc/localtime -files /var/lib/systemd/random-seed -files /var/spool -files /var/lib/samba -files /var/log/audit/audit.log -files /var/lib/nfs diff --git a/service b/service deleted file mode 100755 index 31d8f3e1..00000000 --- a/service +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -. /etc/init.d/functions - -VERSION="$(basename $0) ver. 1.1" -USAGE="Usage: $(basename $0) < option > | --status-all | \ -[ service_name [ command | --full-restart ] ]" -SERVICEDIR="/etc/init.d" -ACTIONDIR="/usr/libexec/initscripts/legacy-actions" -SERVICE= -ACTION= -OPTIONS= - -if [ $# -eq 0 ]; then - echo "${USAGE}" >&2 - exit 1 -fi - -cd / -while [ $# -gt 0 ]; do - case "${1}" in - --help | -h | --h* ) - echo "${USAGE}" >&2 - exit 0 - ;; - --version | -V ) - echo "${VERSION}" >&2 - exit 0 - ;; - --ignore-dependencies) - export SYSTEMCTL_IGNORE_DEPENDENCIES=1 - shift - ;; - --skip-redirect) - export SYSTEMCTL_SKIP_REDIRECT=1 - shift - ;; - *) - if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then - cd ${SERVICEDIR} - for SERVICE in * ; do - case "${SERVICE}" in - functions | halt | killall | single| linuxconf| kudzu) - ;; - *) - if ! is_ignored_file "${SERVICE}" \ - && [ -x "${SERVICEDIR}/${SERVICE}" ]; then - env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" status - fi - ;; - esac - done - exit 0 - elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then - SERVICE="${1}" - if [ -x "${SERVICEDIR}/${SERVICE}" ]; then - env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" stop - env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" start - exit $? - fi - elif [ -z "${SERVICE}" ]; then - SERVICE="${1}" - elif [ -z "${ACTION}" ]; then - ACTION="${1}" - else - OPTIONS="${OPTIONS} ${1}" - fi - shift - ;; - esac -done - -if [ -f "${SERVICEDIR}/${SERVICE}" ]; then - # LSB daemons that dies abnormally in systemd looks alive in systemd's eyes due to RemainAfterExit=yes - # lets reap them before next start - if [ "${ACTION}" = "start" ] && \ - systemctl show -p ActiveState ${SERVICE}.service | grep -q '=active$' && \ - systemctl show -p SubState ${SERVICE}.service | grep -q '=exited$' ; then - /bin/systemctl stop ${SERVICE}.service - fi - env -i PATH="$PATH" TERM="$TERM" SYSTEMCTL_IGNORE_DEPENDENCIES=${SYSTEMCTL_IGNORE_DEPENDENCIES} SYSTEMCTL_SKIP_REDIRECT=${SYSTEMCTL_SKIP_REDIRECT} "${SERVICEDIR}/${SERVICE}" ${ACTION} ${OPTIONS} -elif [ -n "${ACTION}" ] && [ -x "${ACTIONDIR}/${SERVICE}/${ACTION}" ]; then - env -i PATH="$PATH" TERM="$TERM" SYSTEMCTL_IGNORE_DEPENDENCIES=${SYSTEMCTL_IGNORE_DEPENDENCIES} SYSTEMCTL_SKIP_REDIRECT=${SYSTEMCTL_SKIP_REDIRECT} "${ACTIONDIR}/${SERVICE}/${ACTION}" ${OPTIONS} -elif `echo $ACTION | grep -Eqw "start|stop|restart|try-restart|reload|force-reload|status|condrestart"` ; then - SERVICE_MANGLED=$(/usr/bin/systemd-escape --mangle ${SERVICE}) - echo $"Redirecting to /bin/systemctl ${ACTION}${OPTIONS:+ }${OPTIONS} ${SERVICE_MANGLED}" >&2 - exec /bin/systemctl ${ACTION} ${OPTIONS} ${SERVICE_MANGLED} -else - echo $"The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl." >&2 - exit 2 -fi diff --git a/service.8 b/service.8 deleted file mode 100644 index 2cd0c039..00000000 --- a/service.8 +++ /dev/null @@ -1,91 +0,0 @@ -.\" A man page for service(8). -*- nroff -*- -.\" -.\" Copyright (C) 2006 Red Hat, Inc. All rights reserved. -.\" -.\" This copyrighted material is made available to anyone wishing to use, -.\" modify, copy, or redistribute it subject to the terms and conditions of the -.\" GNU General Public License v.2. -.\" -.\" This program is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -.\" more details. -.\" -.\" You should have received a copy of the GNU General Public License along -.\" with this program; if not, write to the Free Software Foundation, Inc., -.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -.\" -.\" Author: Miloslav Trmac -.TH service 8 "Jan 2006" - -.SH NAME -service \- run a System V init script - -.SH SYNOPSIS -\fBservice\fR \fISCRIPT\fR \fICOMMAND\fR [\fIOPTIONS\fR] - -\fBservice \-\-status\-all\fR - -\fBservice\fR \fB\-\-help\fR | \fB\-h\fR | \fB\-\-version\fR - -.SH DESCRIPTION -.B service -runs a System V init script in as predictable environment as possible, -removing most environment variables -and with current working directory set to \fB/\fR. - -The -.I SCRIPT -parameter specifies a System V init script, -located in \fB/etc/init.d/\fISCRIPT\fR. -The supported values of -.I COMMAND -depend on the invoked script, -.B service -passes -.I COMMAND -and -.I OPTIONS -it to the init script unmodified. -All scripts should support at least the -.B start -and -.B stop -commands. -As a special case, if -.I COMMAND -is \fB\-\-full-restart\fR, the script is run twice, first with the -.B stop -command, then with the -.B start -command. - -.B service \-\-status\-all -runs all init scripts, in alphabetical order, with the -.B status -command. - -If the init script file does not exist, the script tries to use -.B legacy actions. -If there is no suitable legacy action found and -.I COMMAND -is one of actions specified in LSB Core Specification, input is redirected to the -.B systemctl. -Otherwise the command fails with return code 2. - -.SH FILES -.TP -\fB/etc/init.d\fR -The directory containing System V init scripts. - -.SH ENVIRONMENT -.TP -\fBLANG\fR, \fBTERM\fR -The only environment variables passed to the init scripts. - -.SH SEE ALSO -.BR chkconfig (8), -.BR ntsysv(8), -.BR systemd (1), -.BR systemctl (8), -.BR systemd.service (5) diff --git a/src/consoletype.1 b/src/consoletype.1 deleted file mode 100644 index ebd1d88c..00000000 --- a/src/consoletype.1 +++ /dev/null @@ -1,44 +0,0 @@ -.TH CONSOLETYPE 1 "Red Hat, Inc" "RH" \" -*- nroff -*- -.SH NAME -\fBconsoletype -\- print type of the console connected to standard input -.SH SYNOPSIS -\fBconsoletype [\fIstdout\fR] [\fIfg\fR] -.SH DESCRIPTION -\fBconsoletype -prints the type of console connected to standard input, and checks -whether the console connected to standard input is the current -foreground virtual console. With no arguments, it prints -\fIvt\fR -if console is a virtual terminal (/dev/tty* or /dev/console device if not on -a serial console), -\fIserial\fR -if standard input is a serial console (/dev/console or /dev/ttyS*) and -\fIpty\fR -if standard input is a pseudo terminal. -.SH RETURN VALUE -\fBconsoletype -when passed no arguments returns -.TP -\fI0 -if on virtual terminal -.TP -\fI1 -if on serial console -.TP -\fI2 -if on a pseudo terminal. -.TP -When passed the \fIstdout\fR argument, \fBconsoletype\fR returns -.TP -\fI0 -in all cases, and prints the console type to stdout. -.TP -When passed the \fIfg\fR argument, \fBconsoletype\fR returns -.TP -\fI0 -if the console connected to standard input is the current virtual -terminal -.TP -\fI1 -otherwise. diff --git a/src/genhostid.1 b/src/genhostid.1 deleted file mode 100644 index 436d9537..00000000 --- a/src/genhostid.1 +++ /dev/null @@ -1,12 +0,0 @@ -.TH GENHOSTID 1 -.SH NAME -genhostid \- generate and set a hostid for the current host -.SH SYNOPSIS -.B genhostid - -.SH DESCRIPTION -\fBgenhostid\fR generates a random hostid and stores it in /etc/hostid, -if /etc/hostid does not already exist. - -.SH "SEE ALSO" -hostid(1), gethostid(2), sethostid(2) diff --git a/src/ifup.8 b/src/ifup.8 deleted file mode 100644 index 1cf1fcd8..00000000 --- a/src/ifup.8 +++ /dev/null @@ -1,36 +0,0 @@ -.\" Copyright 2009 Petr Lautrbach (plautrba@redhat.com) -.TH ifup 8 2009-10-27 "" "System Administration tools and Daemons" -.SH NAME -ifup - bring a network interface up - -ifdown - take a network interface down -.SH SYNOPSIS -.B ifup CONFIG [boot] - -.B ifdown CONFIG - -.SH DESCRIPTION -The -.B ifup -and -.B ifdown -commands may be used to configure (or, respec- -tively, deconfigure) network interfaces based on interface definitions -in the files /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg- - -These scripts take one argument normally: the name of the configuration -(e.g. eth0). They are called with a second argument of "boot" -during the boot sequence so that devices that are not meant to -be brought up on boot (ONBOOT=no, see below) can be ignored at -that time. - -.SH FILES -.TP -\fB/etc/sysconfig/network\fR - -.TP -\fB/etc/sysconfig/network-scripts/ifcfg-\fR -The file defining an interface. - -.SH "SEE ALSO" -/usr/share/doc/initscripts-*/sysconfig.txt diff --git a/src/netreport.1 b/src/netreport.1 deleted file mode 100644 index 75ed0747..00000000 --- a/src/netreport.1 +++ /dev/null @@ -1,22 +0,0 @@ -.TH NETREPORT 1 "Red Hat, Inc." "RH" \" -*- nroff -*- -.SH NAME -netreport \- request notification of network interface changes -.SH SYNOPSIS -.B netreport -\fI[\fP-r\fI]\fP -.SH DESCRIPTION -.B netreport -tells the network management scripts to send a SIGIO signal -to the process which called netreport when any network interface -status changes occur. -.SH OPTIONS -.TP -.B -r -Remove the current request (if any) for the calling process. -.PP -.SH NOTES -If a program does not call netreport with the -.B -r -option before it exits, and another process is created with the -same PID before any changes take place in interface status, it -is possible that the new process will receive a spurious SIGIO. diff --git a/src/sushell b/src/sushell deleted file mode 100755 index 7d969416..00000000 --- a/src/sushell +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -[ -z "$SUSHELL" ] && SUSHELL=/bin/bash - -exec $SUSHELL diff --git a/src/sushell.8 b/src/sushell.8 deleted file mode 100644 index 9832a732..00000000 --- a/src/sushell.8 +++ /dev/null @@ -1,16 +0,0 @@ -.TH SUSHELL 8 "Red Hat, Inc" \" -*- nroff -*- -.SH NAME -sushell \- execute the single-user shell -.SH SYNOPSIS -.B sushell -.SH DESCRIPTION -.B sushell -executes the single-user shell. By default, this is -\fI/bin/bash\fP -This can be configured via the -.B SUSHELL -environment variable. -.SH NOTES -.B sushell -is an implementation detail, required for proper SELinux -usage. It is not intended to be run regularly. diff --git a/src/usernetctl.8 b/src/usernetctl.8 deleted file mode 100644 index 2fb84da1..00000000 --- a/src/usernetctl.8 +++ /dev/null @@ -1,39 +0,0 @@ -.TH USERNETCTL 8 "Red Hat, Inc." "RHS" \" -*- nroff -*- -.SH NAME -usernetctl \- allow a user to manipulate a network interface if permitted -.SH SYNOPSIS -.B usernetctl -\fIinterface-name\fP up\fI|\fPdown\fI|\fPreport -.SH DESCRIPTION -.B usernetctl -checks to see if users are allowed to manipulate the network interface -specified by \fIinterface-name\fP, and then tries to bring the network -interface up or down, if up or down was specified on the command line, -or returns true or false status (respectively) if the report option was -specified. - -.B usernetctl -is not really meant to be called directly by users, though it currently -works fine that way. It is used as a wrapper by the ifup and ifdown -scripts, so that users can do exactly the same thing as root: -.nf -ifup \fIinterface-name\fP -ifdown \fIinterface-name\fP -.fi -and \fBifup\fP and \fBifdown\fP will call usernetctl automatically to -allow the interface status change. -.SH OPTIONS -.TP -.I "\fIinterface-name" -The name of the network interface to check; for example, "ppp0". For -backwards compatibility, "ifcfg-ppp0" and -"/etc/sysconfig/network-scripts/ifcfg-ppp0" are also supported. -.TP -up\fI|\fPdown -Attempt to bring the interface up or down. -.TP -report -Report on whether users can bring the interface up or down. -.SH NOTES -Alternate device configurations may inherit the default configuration's -permissions. diff --git a/src/usleep.1 b/src/usleep.1 deleted file mode 100644 index 30db2bad..00000000 --- a/src/usleep.1 +++ /dev/null @@ -1,30 +0,0 @@ -.TH USLEEP 1 "Red Hat, Inc" \" -*- nroff -*- -.SH NAME -usleep \- sleep some number of microseconds -.SH SYNOPSIS -.B usleep -[\fInumber\fP] -.SH DESCRIPTION -.B usleep -sleeps some number of microseconds. The default is 1. -.SH WARNING -.B usleep -has been deprecated, and will be removed in near future. Use sleep(1) instead. -.SH OPTIONS -\fI--usage\fP -Show short usage message. -.TP -\fI--help, -?\fP -Print help information. -.TP -\fI-v, --version\fP -Print version information. -.SH BUGS -Probably not accurate on many machines down to the microsecond. Count -on precision only to -4 or maybe -5. -.SH AUTHOR -Donald Barnes -.br -Erik Troan -.SH SEE ALSO -sleep(1) diff --git a/statetab b/statetab deleted file mode 100644 index f06981ac..00000000 --- a/statetab +++ /dev/null @@ -1,12 +0,0 @@ -# -# A list of paths which should be bind-mounted from a -# partition dedicated to persistent data -# -# See $STATE_LABEL in /etc/sysconfig/readonly-root -# -# Examples: -# -# /root -# /etc/ssh -# /var/spool/mail -# diff --git a/static-routes-ipv6 b/static-routes-ipv6 deleted file mode 100644 index a4c3b8d9..00000000 --- a/static-routes-ipv6 +++ /dev/null @@ -1,21 +0,0 @@ -# Version: 2002-01-09 - -# file: /etc/sysconfig/static-routes-ipv6 -# -# description: this file contains all static IPv6 routes -# description: Here you can specify several routes to specified gateways -# description: and also route through a virtual tunnel interface -# -# (P) 2000-2002 by Peter Bieringer - -#Device IPv6 network to route IPv6 gateway address - -## Example: static routes through a gateway on local link -#eth0 fec0:0:0:2::/64 fec0:0:0:1:0:0:0:20 -#eth0 3ffe:ffff:1234::/48 3ffe:ffff:1234:0002:0:0:0:1 - -## Example: default route through a gateway on local link -#eth0 2000::/3 3ffe:ffff:1234:0002:0:0:0:1 - -## Example: static route through a dedicated tunnel -#sit1 3ffe:ffff:1234::/48 diff --git a/sys-unconfig b/sys-unconfig deleted file mode 100644 index b5f4d78c..00000000 --- a/sys-unconfig +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -. /etc/init.d/functions - -if [ $# -ne 0 ]; then - echo $"Usage: sys-unconfig" >&2 - exit 1 -fi - -touch /.unconfigured -rm -f /etc/udev/rules.d/*-persistent-*.rules -poweroff diff --git a/sys-unconfig.8 b/sys-unconfig.8 deleted file mode 100644 index 9edc1068..00000000 --- a/sys-unconfig.8 +++ /dev/null @@ -1,29 +0,0 @@ -.TH SYS-UNCONFIG 8 "Wed Jul 28 1999" -.SH NAME -sys-unconfig \- shell script to reconfigure the system upon next boot -.SH SYNOPSIS -\fBsys-unconfig\fR -.SH DESCRIPTION -\fBsys-unconfig\fR provides a simple method of reconfiguring a system -in a new environment. Upon executing sys-unconfig will poweroff your -system, and run firstboot at next boot. - -.SH FILES -.PD 0 -.TP 20 -\fI/.unconfigured\fR -The presence of this file will trigger firsboot. - -.SH NOTES -.PD -This utility should not be used for creating cloud or virtual machine images. -For that use please see \fBvirt-sysprep\fP. - -.PD -.SH "SEE ALSO" -.BR virt-sysprep(1) - -.SH AUTHORS -.nf -H.J. Lu -.fi diff --git a/sysconfig.txt b/sysconfig.txt deleted file mode 100644 index df4f789a..00000000 --- a/sysconfig.txt +++ /dev/null @@ -1,1083 +0,0 @@ - -======================= - -Generic options: - -/etc/sysconfig/* - - CGROUP_DAEMON= - List of control groups that the daemon will be run in. For example, - CGROUP_DAEMON="cpu:daemons cpuacct:/" will run it in the daemons - group for the CPU controller, and the '/' group for the CPU accounting - controller. - -/etc/sysconfig/authconfig - - used by authconfig to store information about the system's user - information and authentication setup; changes made to this file - have no effect until the next time authconfig is run - - USEHESIOD=no - Whether or not the hesiod naming service is in use. If not set, - authconfig examines the passwd setting in /etc/nsswitch.conf. - USELDAP=no - Whether or not LDAP is used as a naming service. If not set, - authconfig examines the passwd setting in /etc/nsswitch.conf. - USENIS=no - Whether or not NIS is in use. If not set, authconfig examines - the passwd setting in /etc/nsswitch.conf. - - USEKERBEROS=no - Whether or not Kerberos is in use. If not set, authconfig examines - the settings in /etc/pam.d/system-auth. - USELDAPAUTH=no - Whether or not LDAP is being used for authentication. If not set, - authconfig examines the settings in /etc/pam.d/system-auth. Note - that this option is separate from USELDAP, and that neither implies - the other. - USEMD5=no - Whether or not MD5-based hashing should be used when setting passwords. - If not set, authconfig examines the settings in /etc/pam.d/system-auth. - This option affects authentication using both local files and LDAP. - USESHADOW=no - Whether or not shadow passwords are in use. If not set, authconfig - checks for the existence of /etc/shadow. - USESMBAUTH=no - Whether or not SMB authentication is in use. If not set, authconfig - examines the settings in /etc/pam.d/system-auth. - -/etc/sysconfig/autofsck - - does not normally exist; if it does, it can influence a choice - whether or not to fsck after a crash - - AUTOFSCK_DEF_CHECK=no - If the user does not respond, choose whether or not to fsck - AUTOFSCK_SINGLEUSER= - If this is set, drop to single user mode before fsck. - -/etc/sysconfig/clock: - - Current releases use the third parameter in the /etc/adjtime - file (either 'UTC' or 'LOCAL') to determine whether the hwclock - is in UTC or localtime. - - ZONE="filename" indicates the zonefile under /usr/share/zoneinfo - that /etc/localtime is a copy of, for example: - ZONE="US/Eastern" - - deprecated values from earlier releases: - - CLOCKMODE=GMT indicates that the clock is set to UTC - CLOCKMODE=ARC on alpha only indicates the ARC console's - 42-year time offset is in effect - UTC=true,yes - Indicates that the hardware clock is set to UTC. - UTC=no,false - Indicates that the hardware clock is set to Local Time. - ARC=true on alpha only indicates the ARC console's - 42-year time offset is in effect; otherwise the normal - Unix epoch is assumed. - - SRM=true on alpha only indicates the SRM 1900 epoch is in - effect; otherwise the normal Unix epoch is assumed. - -/etc/sysconfig/init: - - BOOTUP= - BOOTUP=graphical means use X Windows graphical boot up - BOOTUP=color means colorized text mode boot display. - BOOTUP=verbose means old style display - Anything else means simplified display, but without color or ANSI-formatting - LOGLEVEL= - Sets the initial console logging level for the kernel. - The default is 7. 8 means everything (including debugging); - 1 means nothing except kernel panics. syslogd will override - this once it starts. - RES_COL= - Column of the screen to start status labels at. Defaults to 60 - MOVE_TO_COL= - A command to move the cursor to $RES_COL. Defaults to nasty - ANSI sequences output by echo -e. - SETCOLOR_SUCCESS= - A command to set the color to a color indicating success. - Defaults to nasty ANSI sequences output by echo -e setting - the color to green. - SETCOLOR_FAILURE= - A command to set the color to a color indicating failure. - Defaults to nasty ANSI sequences output by echo -e setting - the color to red. - SETCOLOR_WARNING= - A command to set the color to a color indicating warning. - Defaults to nasty ANSI sequences output by echo -e setting - the color to yellow. - SETCOLOR_NORMAL= - A command to set the color to 'normal'. Defaults to nasty - ANSI sequences output by echo -e. - PROMPT=yes|no - Set to 'yes' to enable the key check for interactive mode as well as - asking if a filesystem check should be done. Default is 'no' and - the kernel command line option "forcefsck" can be used to check the - filesystems and "confirm" can be used to enable interactive startup - questions. - - obsoleted values from earlier releases: - - MAGIC_SYSRQ=yes|no - Setting this to 'no' used to disable the magic sysrq key and - Stop-A (break on serial console) on SPARC. This setting has been - moved into kernel.sysrq and kernel.stop-a settings respectively in - sysctl.d/00-system.conf. Setting either of them there to 0 disables - it, setting it to 1 enables it. - STOP_A=yes|no - Setting this to 'no' used to disable the Stop-A (break on - serial console) key on SPARC. - This setting has been moved into kernel.stop-a setting in - sysctl.d/00-system.conf. Setting it there to 0 disables it, - setting it to 1 enables it. The setting should be present - on SPARC only. - -/etc/sysconfig/keyboard: - - KEYTABLE= - for example: KEYTABLE="/usr/lib/kbd/keytables/us.map" - - If you dump a keymap (using 'dumpkeys') to - /etc/sysconfig/console/default.kmap - it will be loaded on bootup before filesystems are mounted/checked. - This could be useful if you need to emergency type the root password. - This has to be a dumped keymap, as opposed to copying the shipped - keymap files, as the shipped files include other maps from the - /usr/lib/kbd/keytables directory. - - KEYBOARDTYPE=sun|pc - on SPARC only, sun means a sun keyboard is attached on /dev/kbd, - pc means a PS/2 keyboard is on ps/2 port. - -/etc/sysconfig/mouse: - - MOUSETYPE=microsoft|mouseman|mousesystems|ps/2|msbm|logibm|atibm| - logitech|mmseries|mmhittab - XEMU3=yes|no (emulate three buttons with two buttons whenever - necessary, most notably in X) - DEVICE= (the device of the mouse) - - In addition, /dev/mouse points to the mouse device. - -/etc/sysconfig/network: - - NETWORKING=yes|no - GATEWAY= - GATEWAYDEV= (e.g. eth0) - NISDOMAIN= - NOZEROCONF= - Set this to not set a route for dynamic link-local addresses. - - NETWORKDELAY= - Delay in seconds after all network interfaces are initialized. Useful if - network has spanning tree running and must wait for STP convergence. - Default: 0 (no delay) - - IFDOWN_ON_SHUTDOWN=yes|no - If yes, do bring interfaces down during system shutdown. If no, leave them - in their current state (this is only supported on hosts using systemd). - Default: yes (bring interfaces down) - - - IPV6FORWARDING=yes|no - Enable or disable global forwarding of incoming IPv6 packets - on all interfaces. - Note: Actual packet forwarding cannot be controlled per-device, use netfilter6 for such issues - Default: no - - IPV6_AUTOCONF=yes|no - Sets the default for device-based autoconfiguration. - Default: yes if IPV6FORWARDING=no, no if IPV6FORWARDING=yes - IPV6_ROUTER=yes|no - Sets the default for device-based Host/Router behaviour. - Default: yes if IPV6FORWARDING=yes, no if IPV6FORWARDING=no - IPV6_AUTOTUNNEL=yes|no - Controls automatic IPv6 tunneling. - Default: no - - IPV6_DEFAULTGW= (optional) - Add a default route through specified gateway - An interface can be specified: required for link-local addresses - Examples: - IPV6_DEFAULTGW="3ffe:ffff:1234:5678::1" - Add default route through 3ffe:ffff:1234:5678::1 - IPV6_DEFAULTGW="3ffe:ffff:1234:5678::1%eth0" - Add default route through 3ffe:ffff:1234:5678::1 and device eth0 - IPV6_DEFAULTGW="fe80::1%eth0" - Add default route through fe80::1 and device eth0 - - Note: if IPV6_DEFAULTGW is specified with %interface scope and it - doesn't match IPV6_DEFAULTDEV, IPV6_DEFAULTDEV is ignored. - Note: it's preferred to use %interface for all addresses, not - just link-local if you have multiple IPv6-enabled interfaces. - - IPV6_DEFAULTDEV= (optional) - Add a default route through specified interface without specifying next hop - Type of interface will be tested whether this is allowed - Examples: - IPV6_DEFAULTDEV="eth0" INVALID example! - IPV6_DEFAULTDEV="ppp0" - IPV6_DEFAULTDEV="sit1" - Examples for 6to4 - IPV6_DEFAULTDEV="tun6to4" - Add default route through dedicated 6to4 tunnel device "tun6to4", if configured - - Note: "tun6to4" does not support an additional IPV6_DEFAULTGW. - Other interfaces prefer IPV6_DEFAULTGW, if specified. - - IPV6_RADVD_PIDFILE= (optional) - Location of PID file for controlling radvd, see IPV6_CONTROL_RADVD - Default: "/run/radvd/radvd.pid" - Example: - IPV6_RADVD_PIDFILE="/some/other/location/radvd.pid" - IPV6TO4_RADVD_PIDFILE= (obsolete) - As above, still supported for a while for backward compatibility. - IPV6_RADVD_TRIGGER_ACTION=startstop|reload|restart|SIGHUP (optional) - How to trigger radvd in case of 6to4 or PPP action - startstop: radvd starts if interface goes up and stops - if interface goes down using initscript call of radvd with related parameter - reload|restart: initscript of radvd is called with this parameter - SIGHUP: signal HUP is sent to radvd, pidfile must be specified, if not the default - Default: SIGHUP - - IPv6 options above can be overridden in interface-specific configuration. - - obsoleted values from earlier releases: - - FORWARD_IPV4=yes|no - Create a new file in /etc/sysctl.d/ with the net.ipv4.ip_forward - setting instead. Setting it to 1 there enables IP forwarding, - setting it to 0 disables it (which is the default for RFC compliance). - - NETWORKWAIT=yes|no - This is not used with the move to systemd. - - HOSTNAME= - This is now configured in /etc/hostname. - -/etc/sysconfig/static-routes-ipv6: - Contains lines of the form: - - IPv6-network IPv6-gateway - IPv6-network - - must be a device name to have the route brought up and - down with the device - - For example: - - eth0 fec0:0:0:2::/64 fec0:0:0:1:0:0:0:20 - adds a route for IPv6 network fec0:0:0:2::/64 through fec0:0:0:1:0:0:0:20 - - eth0 2000::/3 3ffe:ffff:0:1::1 - so-called "default" routes for clients - - sit1 2000::/3 - adds routes through dedicated tunnel interface sit1 - - tun6to4 3ffe:ffff:1234::/56 - adds routes through hardwired 6to4 tunnel interface tun6to4 - tun6to4 3ffe:ffff:5678::/56 ::5.6.7.8 - adds routes through hardwired 6to4 tunnel interface tun6to4, - specifying next hop - - Notes: - * default routes (such as the "2000::/3" shown above) should be set with - IPV6_DEFAULTGW and IPV6_DEFAULTDEV, see more above. - * tunnel device "sit0" is not supported here, routes will never be applied - -/etc/sysconfig/routed: - - SILENT=yes|no - EXPORT_GATEWAY=yes|no - -/etc/sysconfig/rawdevices: - - This is used for setting up raw device to block device mappings. - It has the format: - - - For example: - /dev/raw/raw1 /dev/sda1 - /dev/raw/raw2 8 5 - -/etc/sysconfig/pcmcia: - - PCMCIA=yes|no - PCIC=i82365|tcic - PCIC_OPTS= - CORE_OPTS= - CARDMGR_OPTS= - -/etc/sysconfig/amd: - - ADIR=/.automount (normally never changed) - MOUNTPTS='/net /etc/amd.conf' (standard automount stuff) - AMDOPTS= (extra options for AMD) - -/etc/sysconfig/tape: - - DEV=/dev/nst0 - Tape device. Use the non-rewinding one for these scripts. - - For SCSI tapes this is /dev/nst#, where # is the number of the - tape drive you want to use. If you only have one then use - nst0. - - For IDE tapes you use /dev/ht#, where # is the number of the tape - drive you want to use (usually ht0). - - For floppy tape drives use /dev/ftape. - - ADMIN=root - Person to mail to if the backup fails for any reason - - SLEEP=5 - Time to sleep between tape operations. Some drives need a bit - more than others, but 5 seems to work for 8mm, 4mm, and DLT - - BLOCKSIZE=32768 - This worked fine for 8mm, then 4mm, and now DLT. An optimal - setting is probably however much data your drive writes at one - time. - - SHORTDATE=$(date +%y:%m:%d:%H:%M) - A short date string, used in backup log filenames. - - DAY=$(date +log-%y:%m:%d) - This is used for the log file directory. - - DATE=$(date) - Regular date string, used in log files. - - LOGROOT=/var/log/backup - Root of the logging directory - - LIST=$LOGROOT/incremental-list - This is the file name the incremental backup will use to store - the incremental list. It will be $LIST-{some number}. - - DOTCOUNT=$LOGROOT/.count - For counting as you go to know which incremental list to use - - COUNTER=$LOGROOT/counter-file - For rewinding when done...might not use. - - BACKUPTAB=/etc/backuptab - The file in which we keep our list of backup(s) we want to make. - -/etc/sysconfig/saslauthd: - - used by the saslauthd init script (part of the cyrus-sasl package) to - control which arguments are passed to saslauthd at startup time; changes - made to this file have no effect until saslauthd is restarted - - MECH=shadow - controls which data source saslauthd will consult when checking user - passwords; run 'saslauthd -v' to get a full list of available - authentication mechanisms - SOCKETDIR=/run/saslauthd - controls in which directory saslauthd will be directed to create its - listening socket; any change to this value will require a corresponding - change in client configuration files - -/etc/sysconfig/sendmail: - DAEMON=yes|no - yes implies -bd (i.e., listen on port 25 for new mail) - 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. - -/etc/locale.conf - - A configutration file for locale settings. See locale.conf(5) for - more details. - - LANG= set locale for all categories, can be any two letter ISO - language code - LC_CTYPE= locale data configuration for classification and conversion - of characters - LC_COLLATE= locale data configuration for collation (sort order) of - strings - LC_MESSAGES= locale data configuration for translation of messages - LC_NUMERIC= locale data configuration for non-monetary numeric data - LC_MONETARY= locale data configuration for monetary data - LC_TIME= locale data configuration for date and time - LC_ALL= locale data configuration overriding all of the above - LANGUAGE= can be a : separated list of ISO language codes - LINGUAS= can be a ' ' separated list of ISO language codes - - The above variables are used in /etc/profile.d/lang.sh. - - If ~/.i18n exists, it is used in addition to /etc/locale.conf and - for per-user customization of the locales. - -/etc/vconsole.conf: - - SYSFONT= Console font. Fonts are found in /lib/kbd/consolefonts. - - UNIMAP= Unicode font map. Most fonts have these built-in. Font maps - can be found in /lib/kbd/unimaps. These are applied via setfont's - -u option. - - SYSFONTACM= Console map. These are applied via setfont's -m option, - and are found in /lib/kbd/consoletrans. - - The above are used to set up the keyboard at boot time. For more - information, see vconsole.conf(5). - -Files in /etc/sysconfig/network-scripts/ -======================================== - -/etc/sysconfig/network-scripts/ifup: -/etc/sysconfig/network-scripts/ifdown: - - Symlinks to /sbin/ifup and /sbin/ifdown, respectively. - These are the only two scripts "in" this directory that should - be called directly; these two scripts call all the other - scripts as needed. These symlinks are here for legacy purposes -- - only /sbin/ifup and /sbin/ifdown should currently be used - at the user level. - - These scripts take one argument normally: the name of the device - (e.g. eth0). They are called with a second argument of "boot" - during the boot sequence so that devices that are not meant to - be brought up on boot (ONBOOT=no, see below) can be ignored at - that time. - - Also, interfaces may be brought up via the hotplug scripts; - in this case, HOTPLUG=no needs to be set to no to avoid this. - This is useful e.g. to prevent bonding device activation by merely - loading the bonding kernel module. - -/etc/sysconfig/network-scripts/init.ipv6-global: - Not really a public file. Contains different basic settings that - are set from /etc/[rc.d]/init.d/network at different stages of - network initialization. - -/etc/sysconfig/network-scripts/network-functions: - - Not really a public file. Contains functions which the scripts use - for bringing interfaces up and down. In particular, it contains - most of the code for handling alternative interface configurations - and interface change notification through netreport. - -/etc/sysconfig/network-scripts/network-functions-ipv6: - - Not really a public file. Contains functions which the scripts use - for bringing IPv6 on interfaces up and down, like addresses, routes, - forwarding handling and static or automatic tunneling. - -/etc/sysconfig/network-scripts/ifcfg- and -/etc/sysconfig/network-scripts/ifcfg-:: - - The first defines an interface, and the second contains - only the parts of the definition that are different in a - "alias" (or alternative) interface. For example, the - network numbers might be different, but everything else - might be the same, so only the network numbers would be - in the alias file, but all the device information would - be in the base ifcfg file. - - The items that can be defined in an ifcfg file depend on the - interface type. The really obvious ones I'm not going to - bother to define; you can figure out what "IPADDR" is, I - think... :-) - - Base items: - NAME= - Most important for PPP. Only used in front ends. - DEVICE= - IPADDRn= - PREFIXn= - Network prefix. It is used for all configurations except aliases - and ippp devices. It takes precedence over NETMASK when both - PREFIX and NETMASK are set. - NETMASKn= - Subnet mask; just useful for aliases and ippp devices. For all other - configurations, use PREFIX instead. - - The "n" is expected to be consecutive positive integers starting from 0. - It can be omitted if there is only one address being configured. - - GATEWAY= - METRIC= - Metric for the default route using GATEWAY - ONBOOT=yes|no (not valid for alias devices; use ONPARENT) - HOTPLUG=yes|no - USERCTL=yes|no - BOOTPROTO=none|bootp|dhcp - 'bootp' or 'dhcp' cause a DHCP client to run on the device. Any other - value causes any static configuration in the file to be applied. - VLAN=yes|no - MTU= - Default MTU for this device - WINDOW= - Default window for routes from this device - PEERDNS=yes|no - modify /etc/resolv.conf if peer uses msdns extension (PPP only) or - DNS{1,2} are set, or if using dhclient. default to "yes". - DNS{1,2}= - provide DNS addresses that are dropped into the resolv.conf - file if PEERDNS is not set to "no". - SCOPE= - Set to "scope SCOPE-ID" to set a non-default scope for a statically - configured IP address. - SRCADDR= - use the specified source address for outgoing packets - HWADDR= - ethernet hardware address for this device - MACADDR= - Set the hardware address for this device to this. - Use of this in conjunction with HWADDR= may cause - unintended behavior. - NOZEROCONF= - Set this to not set a route for dynamic link-local addresses - over this device. - PERSISTENT_DHCLIENT=yes|no|1|0 - Without this option, or if it is 'no'/'0', and BOOTPROTO=dhcp, - dhclient is run for the interface in "one-shot" mode; if the - dhcp server does not respond for a configurable timeout, then - dhclient exits and the interface is not brought up - - the '-1' option is given to dhclient. - If PERSISTENT_DHCLIENT=yes, then dhclient will keep on trying - to contact the dhcp server when it does not respond - no '-1' - option is given to dhclient. Note: this disables the automatic - checking for the presence of a link before starting dhclient. - DHCPRELEASE=yes|no|1|0 - With this option set to 'yes' (1), when a dhcp configured - interface is brought down with 'ifdown', the lease will be - released. Otherwise, leases are not released. - - NO_DHCP_HOSTNAME=yes|no|1|0 - Tells initscripts to not obtain hostname from DHCP server in the ifup-post - phase. This option might be useful especially with static configuration of - the interface. - DHCP_SEND_HOSTNAME=yes|no|1|0 - Tells initscripts whether the DHCP_HOSTNAME or DHCP_FQDN options (below) - should be sent to DHCP server. - DHCP_HOSTNAME= - Sends the specified hostname to the DHCP server. - DHCP_FQDN= - Sends the specified FQDN to the DHCP server. - - Please note when both DHCP_HOSTNAME and DHCP_FQDN are specified, - only DHCP_FQDN will be used. (Same behaviour as with NetworkManager.) - - DHCLIENT_IGNORE_GATEWAY=yes|no|1|0 - If set to 'yes', it will cause dhclient-script to ignore any $GATEWAY - setting that may be in the ifcfg file for this interface. - Otherwise, the dhclient session which obtains an ip-address - on the same subnet as $GATEWAY will set the default route - to be via $GATEWAY, and no other dhclient session will set - the default route. - DHCLIENTARGS= - Any additional arguments to dhclient. - NM_CONTROLLED=yes|no - If set to 'no', NetworkManager will ignore this connection/device. - Defaults to 'yes'. - ZONE= - Network zone (trust level) of this connection. - If not set, default zone (specified in /etc/firewalld/firewalld.conf) - is used. To see all available zones, run 'firewall-cmd --get-zones'. - ARPCHECKn=yes|no - If set to 'no', ifup will not try to determine, if requested ip address - is used by other machine in network. - Defaults to 'yes'. - ARPUPDATE=yes|no - If set to 'no' the neighbours in current network will not be updated with - ARP information about this NIC. This is especially handy using LVS Load - Balancing with Direct Routing enabled. - Defaults to 'yes'. - IPV4_FAILURE_FATAL=yes|no - If set to yes, ifup-eth will end immediately after ipv4 dhclient fails. - Defaults to 'no'. - - For dynamic addressing (BOOTPROTO=dhcp) only DEVICE needs to - be set; all the rest will be determined by the boot protocol. - - IPV6_SET_SYSCTLS=yes|no - If set, network-scripts will attempt to set sysctls based on the setup - of the interface. For example, will try to set `accept_ra` for interfaces - where $IPV6_AUTOCONF is set to `yes`. Defaults to `yes`, set to `no` if you - want to manage these yourself. - - Base items being deprecated: - NETWORK= - BROADCAST= - - Alias specific items: - ONPARENT=yes|no - Whether to bring up the device when the parent device is brought - up. - Default: yes - - IPv6-only items for real interfaces: - IPV6INIT=yes|no - Enable or disable IPv6 static, DHCP, or autoconf configuration for this interface - Default: yes - IPV6FORWARDING=yes|no - Enable or disable global forwarding of incoming IPv6 packets - Note: Obsolete in interface specification! - Default: no - IPV6ADDR=[/] - Specify a primary static IPv6 address here - Optional, if normal host and a router advertisement daemon is on local link - Required, if node is a router and interface should route packets - Note: if prefix length is omitted, 64 is assumed - Example: - IPV6ADDR="3ffe:ffff:0:5::1" - IPV6ADDR="3ffe:ffff:0:1::1/128" - IPV6ADDR_SECONDARIES="[/] ..." (optional) - A list of secondary IPv6 addresses (e.g. useful for virtual hosting) - Example: - IPV6ADDR_SECONDARIES="3ffe:ffff:0:1::10 3ffe:ffff:0:2::11/128" - IPV6_MTU= (optional) - Optional, dedicated MTU of this link - Note: Must be greater or equal to 1280. - Example: - IPV6_MTU="1280" - IPV6_PRIVACY=rfc3041 - Enables RFC 3041 IPv6 privacy support if set. - Default: RFC 3041 support disabled - IPV6_FORCE_ACCEPT_RA=yes|no - By default network-scripts will set `accept_ra` only if $IPV6_AUTOCONF is - set to `yes`. If you don't want SLAAC addresses but do want to accept RA, - then set this to `yes`. Defaults to `no`. - - Special configuration options for multi-homed hosts etc. - IPV6_ROUTER=yes|no: Controls IPv6 autoconfiguration - IPV6_AUTOCONF=yes|no: Controls IPv6 autoconfiguration - Defaults: - Global IPV6FORWARDING=yes: IPV6_AUTOCONF=no, IPV6_ROUTER=yes - Global IPV6FORWARDING=no: IPV6_AUTOCONF=yes - - Optional settings for a 6to4 tunnel - IPV6TO4INIT=yes|no - Enable or disable 6to4 tunneling setup - Default: no - IPV6TO4_RELAY= (optional) - IPv4 address of the remote 6to4 relay - Note: if this is omitted, ::192.88.99.1 (the anycast relay address) is chosen - IPV6TO4_IPV4ADDR=[/] (optional) - Overwrite local IPv4 address which is accessible from the Internet - (optional, in case of static IPv4-NAT behind a router or other special scenarios) - IPV6TO4_MTU= (optional) - Controls IPv6 MTU for the 6to4 tunnel - Note: Must be greater or equal to 1280 - Example: - IPV6TO4_MTU="1280" - Default: MTU of master device - 20 - IPV6TO4_ROUTING="-/ ..." (optional) - A list of routing tokens to setup proper IPv6 interfaces on the LAN - Example: - IPV6TO4_ROUTING="eth0-:0004::1/64 eth1-:0005::1/64" - Will create one address per eth0 and eth1, taking given SLA - - Optional settings for a 6to4 tunnel or a ppp link - IPV6_CONTROL_RADVD=yes|no (optional) - Enable signaling radvd that the 6to4 prefix has been changed or a - preconfigured dynamic device is up or down - Default: no - - IPv6-only items for static tunnel interface: - Interface name: sitX (X => 1) - IPV6INIT=yes|no - Enable or disable IPv6 configuration for this interface - Default: no - IPV6TUNNELIPV4= - Specify IPv4 address of a foreign IPv6-in-IPv4 tunnel endpoint - Example: - IPV6TUNNELIPV4="1.2.3.4" - IPV6TUNNELIPV4LOCAL= - Specify local IPv4 address of tunnel, useful on interfaces with multiple IPv4 addresses - IPV6ADDR=[/] (optional) - local IPv6 address of a numbered tunnel - IPV6ADDR_SECONDARIES="[/] ..." (optional) - A list of secondary IPv6 addresses (example see above) - IPV6_MTU= (optional) - Optional, dedicated MTU of this tunnel - Note: Must be greater or equal to 1280 - Example: - IPV6_MTU="1280" - - IPv6-only option to enable DHCPv6 client: - DHCPV6C=yes|no - This will enable the DHCPv6 features of dhclient to be run for the interface. - See man dhclient(8) and dhclient.conf(5). - DHCPV6C_OPTIONS=... - This will pass given arguments to the DHCPv6 client. For example, - "-S" option will request network information (e.g., DNS addresses) - only, not IPv6 addresses. - - Ethernet-only items: - ARP=yes|no (adds 'arp' flag to ip, for use with the - ethertap device) - LINKDELAY=