diff options
author | Christian Heim <phreak@gentoo.org> | 2006-06-05 19:46:54 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2006-06-05 19:46:54 +0000 |
commit | 7ca78946181ba6b0757514586186d030ea774ccb (patch) | |
tree | 9b1f7a9ad67a01c42c71b0abb3dda49192b1d0df | |
parent | Merging r2046 (diff) | |
download | baselayout-vserver-7ca78946181ba6b0757514586186d030ea774ccb.tar.gz baselayout-vserver-7ca78946181ba6b0757514586186d030ea774ccb.tar.bz2 baselayout-vserver-7ca78946181ba6b0757514586186d030ea774ccb.zip |
Merging r2079
svn path=/baselayout-vserver/branches/baselayout-1_12/; revision=372
-rw-r--r-- | ChangeLog | 37 | ||||
-rw-r--r-- | ChangeLog.vserver | 4 | ||||
-rw-r--r-- | etc/conf.d/env_whitelist | 5 | ||||
-rw-r--r-- | etc/group | 1 | ||||
-rw-r--r-- | etc/passwd | 1 | ||||
-rw-r--r-- | net-scripts/conf.d/net.example | 24 | ||||
-rwxr-xr-x | net-scripts/init.d/net.lo | 2 | ||||
-rw-r--r-- | net-scripts/net/arping.sh | 102 | ||||
-rw-r--r-- | net-scripts/net/dhclient.sh | 1 | ||||
-rw-r--r-- | net-scripts/net/netplugd.sh | 5 | ||||
-rw-r--r-- | net-scripts/net/pppd.sh | 3 | ||||
-rwxr-xr-x | sbin/depscan.sh | 8 | ||||
-rwxr-xr-x | sbin/rc | 6 | ||||
-rwxr-xr-x | sbin/rc-update | 2 | ||||
-rw-r--r-- | src/env_whitelist | 16 | ||||
-rwxr-xr-x | tarball.sh | 2 |
16 files changed, 180 insertions, 39 deletions
@@ -1,6 +1,43 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2 +* baselayout-1.12.1 (05 Jun 2006) + + 05 June 2006; Roy Marples <uberlord@gentoo.org>: + + Restore the man user/group, #113298 thanks to Chris Gianelloni. + + Fix typo in /sbin/rc, #135323 thanks to Ed Catmur. + + rc now stops services again, #135340. + + depscan.sh now tries to touch files in with future mtimes so that + users only see the clock skew message once, #135212. + + Show help when rc-update is called without arguments, #133434. + + Ensure that an empty NET_FS_LIST doesn't cause localmount to error, + #132928 thanks to Dominik Buerkle. + + 02 June 2006; Roy Marples <uberlord@gentoo.org>: + + Allow LC_* and LANG vars through to runscript.sh by default. + + net.lo now comes after bootmisc, #135118 thanks to Oldrich Jedlicka. + + arping.sh now has MAC address support, #134253 thanks to Oldrich Jedlicka. + + pppd.sh now updates secret files with a blank password, #134337 + + Remove swapon call from /sbin/rc as localmount already calls it, + #47932 and also a partial fix for #134489 + + 30 May 2006; Roy Marples <uberlord@gentoo.org>: + + Allow users to specify netplugd options. + + Really fix is_xenU_sys, #134571 thanks to Stefan Hellermann. + 24 May 2006; Roy Marples <uberlord@gentoo.org>: Ensure that we call halt.sh in a new shell with LC_ALL=C so that we don't diff --git a/ChangeLog.vserver b/ChangeLog.vserver index 3e28fea..fcba82d 100644 --- a/ChangeLog.vserver +++ b/ChangeLog.vserver @@ -1,6 +1,10 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2 + 05 Jun 2006; Christian Heim <phreak@gentoo.org>: + Merging latest changes to the baselayout-1_12 branch. This merge is based + upon revision 2079. + 25 May 2006; Christian Heim <phreak@gentoo.org>: Merging latest changes to the baselayout-1_12 branch. This merge is based upon revision 2046. diff --git a/etc/conf.d/env_whitelist b/etc/conf.d/env_whitelist index e04ba9e..30a3695 100644 --- a/etc/conf.d/env_whitelist +++ b/etc/conf.d/env_whitelist @@ -4,8 +4,3 @@ # rc-system. If it is not set by the environment, then the variable will be # taken from /etc/profile.env - meaning, if you need to set LANG or such, # do it in a /etc/env.d/99myownstuff file for example, and run env-update. - -# Locale settings -#LANG -#LANGUAGE -#LC_ALL @@ -13,6 +13,7 @@ floppy::11:root mail::12:mail news::13:news uucp::14:uucp +man::15:man console::17: audio::18: cdrom::19: @@ -10,6 +10,7 @@ mail:x:8:12:mail:/var/spool/mail:/bin/false news:x:9:13:news:/usr/lib/news:/bin/false uucp:x:10:14:uucp:/var/spool/uucppublic:/bin/false operator:x:11:0:operator:/root:/bin/bash +man:x:13:15:man:/usr/share/man:/bin/false postmaster:x:14:12:postmaster:/var/spool/mail:/bin/false smmsp:x:209:209:smmsp:/var/spool/mqueue:/bin/false portage:x:250:250:portage:/var/tmp/portage:/bin/false diff --git a/net-scripts/conf.d/net.example b/net-scripts/conf.d/net.example index 10c10c9..1366eea 100644 --- a/net-scripts/conf.d/net.example +++ b/net-scripts/conf.d/net.example @@ -278,6 +278,16 @@ #routes_010000000001=( "default via 10.0.0.1" ) #dns_servers_010000000001=( "10.0.0.1" ) +# We can also specify a specific MAC address for each gateway if different +# networks have the same gateway. +#gateways_eth0="192.168.0.1,00:11:22:AA:BB:CC 10.0.0.1,33:44:55:DD:EE:FF" +#config_192168000001_001122AABBCC=( "192.168.0.2/24" ) +#routes_192168000001_001122AABBCC=( "default via 192.168.0.1" ) +#dns_servers_192168000001_001122AABBCC=( "192.168.0.1" ) +#config_010000000001_334455DDEEFF=( "10.0.0.254/8" ) +#routes_010000000001_334455DDEEFF=( "default via 10.0.0.1" ) +#dns_servers_010000000001_334455DDEEFF=( "10.0.0.1" ) + # If we don't find any gateways (or there are none configured) then we try and # use APIPA to find a free address in the range 169.254.0.0-169.254.255.255 # by arping a random address in that range on the interface. If no reply is @@ -290,6 +300,17 @@ #config_eth0=( "dhcp" ) #fallback_eth0=( "arping" ) +# NOTE: We default to sleeping for 1 second the first time we attempt an +# arping to give the interface time to settle on the LAN. This appears to +# be a good default for most instances, but if not you can alter it here. +#arping_sleep=5 +#arping_sleep_lan=7 + +# NOTE: We default to waiting 3 seconds to get an arping response. You can +# change the default wait like so. +#arping_wait=3 +#arping_wait_lan=2 + #----------------------------------------------------------------------------- # VLAN (802.1q support) # For VLAN support, emerge net-misc/vconfig @@ -378,6 +399,9 @@ #username_ppp0='user' #password_ppp0='password' # +# NOTE: You can set a blank password like so +#password_ppp0= +# # The PPP daemon has many options you can specify - although there are many # and may seem daunting, it is recommended that you read the pppd man page # before enabling any of them diff --git a/net-scripts/init.d/net.lo b/net-scripts/init.d/net.lo index e5e4990..94b85bc 100755 --- a/net-scripts/init.d/net.lo +++ b/net-scripts/init.d/net.lo @@ -12,7 +12,7 @@ # runlevel as the net.* script that needs it. depend() { need localmount - after hostname + after bootmisc hostname use isapnp isdn pcmcia usb wlan # Load any custom depend functions for the given interface diff --git a/net-scripts/net/arping.sh b/net-scripts/net/arping.sh index e889ca1..01d9256 100644 --- a/net-scripts/net/arping.sh +++ b/net-scripts/net/arping.sh @@ -20,6 +20,25 @@ arping_check_installed() { return 1 } +# void arping_sleep(char *interface) +# +# Allows the interface to settle on the LAN - normally takes around 3 seconds +# This requires the use of a global variable, ARPING_SLEPT +arping_sleep() { + local iface="$1" + [[ ${ARPING_SLEPT} == "1" ]] && return + + local ifvar="$(bash_variable "${iface}")" + local s="arping_sleep_${ifvar}" + s="${!s}" + if [[ -z ${s} ]] ; then + s="${arping_sleep}" + s="${s:-1}" + fi + sleep "${s}" + ARPING_SLEPT="1" +} + # bool arping_address_exists(char *interface, char *address) # # Returns 0 if the address on the interface responds to an arping @@ -27,28 +46,52 @@ arping_check_installed() { # If neither arping (net-misc/iputils) or arping2 (net-analyzer/arping) # is installed then we return 1 arping_address_exists() { - local iface="$1" address="${2%%/*}" i + local iface="$1" ip="${2%%/*}" mac="$3" foundmac= i= w= # We only handle IPv4 addresses - [[ ${address} != *.*.*.* ]] && return 1 + [[ ${ip} != *.*.*.* ]] && return 1 # 0.0.0.0 isn't a valid address - and some lusers have configured this - [[ ${address} == "0.0.0.0" || ${address} == "0" ]] && return 1 + [[ ${ip} == "0.0.0.0" || ${ip} == "0" ]] && return 1 # We need to bring the interface up to test interface_exists "${iface}" || return 1 interface_up "${iface}" + arping_sleep + + local ifvar="$(bash_variable "${iface}")" + w="arping_wait_${ifvar}" + w="${!w}" + [[ -z ${w} ]] && w="${arping_wait:-3}" + if [[ -x /sbin/arping ]] ; then - /sbin/arping -q -c 2 -w 3 -D -f -I "${iface}" "${address}" \ - &>/dev/null || return 0 + foundmac="$(arping -c 2 -w "${w}" -D -f -I "${iface}" \ + "${ip}" 2>/dev/null \ + | sed -n 's/.*\[\([^]]*\)\].*/\U\1/p')" elif [[ -x /usr/sbin/arping2 ]] ; then - for (( i=0; i<3; i++ )) ; do - /usr/sbin/arping2 -0 -c 1 -i "${iface}" "${address}" \ - &>/dev/null && return 0 + for (( i=0; i<w; i++ )) ; do + foundmac="$(arping2 -r -0 -c 1 -i "${iface}" \ + "${ip}" 2>/dev/null)" + if [[ $? == "0" ]] ; then + foundmac="$(echo "${foundmac}" \ + | tr '[:lower:]' '[:upper:]')" + break + fi + foundmac= done fi - return 1 + + [[ -z ${foundmac} ]] && return 1 + + if [[ -n ${mac} ]] ; then + if [[ ${mac} != "${foundmac}" ]] ; then + vewarn "Found ${ip} but MAC ${foundmac} does not match" + return 1 + fi + fi + + return 0 } # bool arping_start(char *iface) @@ -57,23 +100,29 @@ arping_address_exists() { # If one is foung then apply it's configuration arping_start() { local iface="$1" gateways x conf i - - interface_exists "${iface}" true || return 1 + local ifvar="$(bash_variable "${iface}")" einfo "Pinging gateways on ${iface} for configuration" gateways="gateways_${ifvar}[@]" if [[ -z "${!gateways}" ]] ; then - eerror "No gateways have been defined (gateways_${ifvar}=\"...\")" + eerror "No gateways have been defined (gateways_${ifvar}=( \"...\"))" return 1 fi eindent for x in ${!gateways}; do - vebegin "${x}" - if arping_address_exists "${iface}" "${x}" ; then - for i in ${x//./ } ; do + local -a a=( ${x//,/ } ) + local ip="${a[0]}" mac="${a[1]}" extra= + if [[ -n ${mac} ]] ; then + mac="$(echo "${mac}" | tr '[:lower:]' '[:upper:]')" + extra="(MAC ${mac})" + fi + + vebegin "${ip} ${extra}" + if arping_address_exists "${iface}" "${ip}" "${mac}" ; then + for i in ${ip//./ } ; do if [[ ${#i} == "2" ]] ; then conf="${conf}0${i}" elif [[ ${#i} == "1" ]] ; then @@ -82,9 +131,11 @@ arping_start() { conf="${conf}${i}" fi done + [[ -n ${mac} ]] && conf="${conf}_${mac//:/}" + veend 0 eoutdent - veinfo "Configuring ${iface} for ${x}" + veinfo "Configuring ${iface} for ${ip} ${extra}" configure_variables "${iface}" "${conf}" # Call the system module as we've aleady passed it by .... @@ -92,13 +143,18 @@ arping_start() { system_pre_start "${iface}" t="config_${ifvar}[@]" - config=( "${!t}" ) - t="fallback_config_${ifvar}[@]" - fallback_config=( "${!t}" ) - t="fallback_route_${ifvar}[@]" - fallback_route=( "${!t}" ) - config_counter=-1 - return 0 + + # Only return if we HAVE a config that doesn't include + # arping to avoid infinite recursion. + if [[ " ${!t} " != *" arping "* ]] ; then + config=( "${!t}" ) + t="fallback_config_${ifvar}[@]" + fallback_config=( "${!t}" ) + t="fallback_route_${ifvar}[@]" + fallback_route=( "${!t}" ) + config_counter=-1 + return 0 + fi fi veend 1 done diff --git a/net-scripts/net/dhclient.sh b/net-scripts/net/dhclient.sh index 81644ac..0e54d21 100644 --- a/net-scripts/net/dhclient.sh +++ b/net-scripts/net/dhclient.sh @@ -103,7 +103,6 @@ dhclient_start() { fi fi - echo "${dhconf}" > /tmp/dhconf-${iface} # Bring up DHCP for this interface (or alias) ebegin "Running dhclient" echo -e "${dhconf}" | start-stop-daemon --start --exec /sbin/dhclient \ diff --git a/net-scripts/net/netplugd.sh b/net-scripts/net/netplugd.sh index f0dfdb7..ac2690f 100644 --- a/net-scripts/net/netplugd.sh +++ b/net-scripts/net/netplugd.sh @@ -34,8 +34,9 @@ netplugd_check_installed() { # # Start netplug on an interface netplugd_pre_start() { - local iface="$1" timeout + local iface="$1" timeout= local pidfile="/var/run/netplugd.${iface}.pid" + local opts="netplugd_$(bash_variable "${iface}")" # We don't start netplug if we're being called from the background ${IN_BACKGROUND} && return 0 @@ -71,7 +72,7 @@ netplugd_pre_start() { # Start netplug start-stop-daemon --start --exec /sbin/netplugd \ --pidfile "${pidfile}" \ - -- -i "${iface}" -P -p "${pidfile}" -c /dev/null + -- ${!opts} -i "${iface}" -P -p "${pidfile}" -c /dev/null eend "$?" || return 1 eindent diff --git a/net-scripts/net/pppd.sh b/net-scripts/net/pppd.sh index feb74d4..24a3d25 100644 --- a/net-scripts/net/pppd.sh +++ b/net-scripts/net/pppd.sh @@ -138,7 +138,8 @@ pppd_start() { password="password_${ifvar}" #Add/update info in PAP/CHAP secrets files - if [[ -n ${!username} && -n ${!password} ]] ; then + if [[ -n ${!username} ]] \ + && [[ -n ${!password} || -z ${!password-x} ]] ; then for i in chap pap ; do if ! pppd_update_secrets_file "/etc/ppp/${i}-secrets" \ "${!username}" "${iface}" "${!password}" ; then diff --git a/sbin/depscan.sh b/sbin/depscan.sh index d0cff4a..7ca6fe2 100755 --- a/sbin/depscan.sh +++ b/sbin/depscan.sh @@ -89,13 +89,17 @@ if ! ${update} ; then fi touch "${mtime_test}" - for config in /etc/conf.d /etc/init.d /etc/rc.conf + for config in /etc/conf.d/* /etc/init.d/* /etc/rc.conf do ! ${update} \ && is_older_than "${mysvcdir}/depcache" "${config}" \ && update=true - is_older_than "${mtime_test}" "${config}" && clock_screw=1 + if is_older_than "${mtime_test}" "${config}" ; then + # Update the file modification time + touch "${config}" &>/dev/null + clock_screw=1 + fi done rm -f "${mtime_test}" @@ -333,9 +333,11 @@ dep_stop() { if [[ ${SOFTLEVEL} != "reboot" \ && ${SOFTLEVEL} != "shutdown" ]] ; then service_coldplugged "${service}" && return 0 - [[ -z ${OLDSOFTLEVEL} ]] \ + if net_service "${service}" ; then + [[ -z ${OLDSOFTLEVEL} ]] \ || ! in_runlevel "${service}" "${OLDSOFTLEVEL}" \ - && return 0 + && return 0 + fi fi # Should not work for 'use' diff --git a/sbin/rc-update b/sbin/rc-update index 28bf91e..82120cf 100755 --- a/sbin/rc-update +++ b/sbin/rc-update @@ -229,7 +229,7 @@ done if [[ -z ${action} ]] ; then eerror "${argv0}: gimme something to do!" 1>&2 - exit 1 + usage 1 fi [[ ${check_root} -eq 1 ]] && check_is_root diff --git a/src/env_whitelist b/src/env_whitelist index ef30661..780afc6 100644 --- a/src/env_whitelist +++ b/src/env_whitelist @@ -21,6 +21,22 @@ USER HOME TERM +# Language variables +LANG +LC_CTYPE +LC_NUMERIC +LC_TIME +LC_COLLATE +LC_MONETARY +LC_MESSAGES +LC_PAPER +LC_NAME +LC_ADDRESS +LC_TELEPHONE +LC_MEASUREMENT +LC_IDENTIFICATION +LC_ALL + # From /sbin/init PATH INIT_VERSION @@ -1,6 +1,6 @@ #!/bin/bash export TMP="${TMP:-/tmp}" -export V="1.12.0" +export V="1.12.1" export NAME="baselayout-vserver" export DEST="${TMP}/${NAME}-${V}" |