diff options
author | 2006-01-10 15:39:39 +0000 | |
---|---|---|
committer | 2006-01-10 15:39:39 +0000 | |
commit | ced906bbd71781d3e5766c470a18619f27386198 (patch) | |
tree | 96ed38ca2bbde50c4cc5f43d1e7eafa80144ccb3 | |
parent | Importing latest baselayout/trunk changes. This is a merge with revision 1768. (diff) | |
download | baselayout-vserver-ced906bbd71781d3e5766c470a18619f27386198.tar.gz baselayout-vserver-ced906bbd71781d3e5766c470a18619f27386198.tar.bz2 baselayout-vserver-ced906bbd71781d3e5766c470a18619f27386198.zip |
Importing latest baselayout/trunk changes. This merge is based upon revision 1797.
svn path=/baselayout-vserver/trunk/; revision=194
72 files changed, 316 insertions, 174 deletions
@@ -1,62 +1,108 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts -# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2 +# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2 - 21 Dec 2005; Roy Marples <uberlord@gentoo.org>: + 09 Jan 2006; Roy Marples <uberlord@gentoo.org>: - Add new variable RC_DOWN_INTERFACE and documentation so that interfaces - are kept up for Wake On LAN support, #113880. + Ensure that specific configuration is loaded after net, #118368. - 21 Dec 2005; Mike Frysinger <vapier@gentoo.org>: + iwconfig now supports multiple iwconfig_* and iwpriv_* statements and is + also configurable for specific ESSIDs. This allows use to use the inbuilt + WPA support in the rt2500 driver. - Make sure /etc/profile.d exists before using it #116232 by Saleem A. + module-loader now loads interface specific configuration files, #118366. - * baselayout-1.12.0_pre12 (20 Dec 2005) + 07 Jan 2006; Roy Marples <uberlord@gentoo.org>: - 20 Dec 2005; Roy Marples <uberlord@gentoo.org>: + Save a few CPU cycles by storing add_suffix in variable. - Ensure that tty has keyboard and stty reports icanon before enabling - interactive rc, #112161. + 06 Jan 2006; Roy Marples <uberlord@gentoo.org>: - 15 Dec 2005; Roy Marples <uberlord@gentoo.org>: + Use ${DEFAULTLEVEL} if ${SOFTLEVEL} is boot, shutdown, reboot or single + in add_suffix. - When setting ad-hoc or master modes, set the mode before anything else, - #115664 thanks to Oldrich Jedlicka. + Sync style changes in functions.sh - 14 Dec 2005; Roy Marples <uberlord@gentoo.org>: + Critical services now load a suffixed config and fail gracefully. - Add great big warning in documentation advising people not to use the - IPv6 examples if they don't have IPv6 enabled in their kernel, #115396. + 05 Jan 2006; Roy Marples <uberlord@gentoo.org>: - 09 Dec 2005; Roy Marples <uberlord@gentoo.org>: + iproute deletes addresses again, fixes #117799. - Remove nasty undocumented backgrounding as we now support - ifplugd, netplug and wpa_supplicant-0.4.x which do much better jobs. + dhclient now supports dhclient-enter-hooks, #117763. - 08 Dec 2005; Mike Frysinger <vapier@gentoo.org>: +* baselayout-1.12.0_pre13 (04 Jan 2006) - Use getent instead of trying to read /etc/groups directly in localmount - #114833 by Justin Sanchez. + 03 Jan 2006; Roy Marples <uberlord@gentoo.org>: - Make modules-update a little more friendly by adding --help, --verbose, - and --debug runtime options. + net scripts now work with bash-3.1-r2, #116352. - Remove rtc clock sleep hack for udev and replace with a modprobe rtc. + 02 Jan 2006; Roy Marples <uberlord@gentoo.org>: - 06 Dec 2005; Roy Marples <uberlord@gentoo.org>: + Interfaces can be dynamically added to bridges again, #117406. + Updated copyright to 2006. - ppp documentation updated, #114551. + 27 Dec 2005; Mike Frysinger <vapier@gentoo.org>: - 05 Dec 2005; Roy Marples <uberlord@gentoo.org>: + Startup volume related stuff (lvm/raid/etc...) in rc instead of + init.d/checkfs (lvm/raid/etc...) #50711. - Fix dhcp options, #114519. + 25 Dec 2005; Mike Frysinger <vapier@gentoo.org>: - 29 Nov 2005; Martin Schlemmer <azarah@gentoo.org>: + Clean up and display the ${TMPFILE2}.err error file in modules-update + where appropriate #116745 by Daniele Gaffuri. - Add po/Makefile, based mostly on work done by Rach Holmes <Rach.Holmes@GMX.net> - and James Rowe <Jay@jnrowe.uklinux.net> since Mike changed most rc-scripts to - support it. + 21 Dec 2005; Roy Marples <uberlord@gentoo.org>: - Set TEXTDOMAIN and TEXTDOMAINDIR. Install locale into $svclib. + Add new variable RC_DOWN_INTERFACE and documentation so that interfaces + are kept up for Wake On LAN support, #113880. + +* baselayout-1.12.0_pre12 (20 Dec 2005) + + 20 Dec 2005; Roy Marples <uberlord@gentoo.org>: + + Ensure that tty has keyboard and stty reports icanon before enabling + interactive rc, #112161. + + 15 Dec 2005; Roy Marples <uberlord@gentoo.org>: + + When setting ad-hoc or master modes, set the mode before anything else, + #115664 thanks to Oldrich Jedlicka. + + 14 Dec 2005; Roy Marples <uberlord@gentoo.org>: + + Add great big warning in documentation advising people not to use the + IPv6 examples if they don't have IPv6 enabled in their kernel, #115396. + + 09 Dec 2005; Roy Marples <uberlord@gentoo.org>: + + Remove nasty undocumented backgrounding as we now support + ifplugd, netplug and wpa_supplicant-0.4.x which do much better jobs. + + 08 Dec 2005; Mike Frysinger <vapier@gentoo.org>: + + Use getent instead of trying to read /etc/groups directly in localmount + #114833 by Justin Sanchez. + + Make modules-update a little more friendly by adding --help, --verbose, + and --debug runtime options. + + Remove rtc clock sleep hack for udev and replace with a modprobe rtc. + + 06 Dec 2005; Roy Marples <uberlord@gentoo.org>: + + ppp documentation updated, #114551. + + 05 Dec 2005; Roy Marples <uberlord@gentoo.org>: + + Fix dhcp options, #114519. + + 29 Nov 2005; Martin Schlemmer <azarah@gentoo.org>: + + Add po/Makefile, based mostly on work done by Rach Holmes <Rach.Holmes@GMX.net> + and James Rowe <Jay@jnrowe.uklinux.net> since Mike changed most rc-scripts to + support it. + + Set TEXTDOMAIN and TEXTDOMAINDIR. Install locale into $svclib. 28 Nov 2005; Roy Marples <uberlord@gentoo.org>: diff --git a/ChangeLog.vserver b/ChangeLog.vserver index 6f49de9..8e13a5c 100644 --- a/ChangeLog.vserver +++ b/ChangeLog.vserver @@ -1,6 +1,64 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2 + 10 Jan 2005; Christian Heim <phreak@gentoo.org>: + Importing latest baselayout/trunk changes. This merge is based upon + revision 1797. + + ChangeLog | 114 ++++++++++++------ + ChangeLog.vserver | 57 +++++++++ + bin/rc-status | 2 + etc/conf.d/domainname | 4 + etc/profile | 14 -- + init.d/bootmisc | 2 + init.d/domainname | 4 + init.d/dummy | 2 + init.d/halt.sh | 2 + init.d/hostname | 2 + init.d/local | 2 + init.d/reboot.sh | 2 + init.d/rmnologin | 2 + init.d/shutdown.sh | 2 + net-scripts/conf.d/net.example | 4 + net-scripts/conf.d/wireless.example | 12 + + net-scripts/init.d/net.lo | 14 +- + net-scripts/net.modules.d/adsl | 2 + net-scripts/net.modules.d/apipa | 2 + net-scripts/net.modules.d/arping | 2 + net-scripts/net.modules.d/bonding | 2 + net-scripts/net.modules.d/bridge | 10 - + net-scripts/net.modules.d/dhclient | 2 + net-scripts/net.modules.d/dhcpcd | 2 + net-scripts/net.modules.d/essidnet | 4 + net-scripts/net.modules.d/helpers.d/dhclient-wrapper | 5 + net-scripts/net.modules.d/helpers.d/dhcp | 2 + net-scripts/net.modules.d/helpers.d/dhcp-state | 2 + net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper | 2 + net-scripts/net.modules.d/helpers.d/functions | 4 + net-scripts/net.modules.d/helpers.d/module-loader | 6 + net-scripts/net.modules.d/helpers.d/pppd-wrapper | 2 + net-scripts/net.modules.d/helpers.d/pump-wrapper | 2 + net-scripts/net.modules.d/helpers.d/udhcpc-wrapper | 2 + net-scripts/net.modules.d/iproute2 | 1 + net-scripts/net.modules.d/iwconfig | 45 ++++--- + net-scripts/net.modules.d/wpa_supplicant | 12 + + sbin/MAKEDEV | 3 + sbin/functions.sh | 29 ++-- + sbin/init-common-post.sh | 2 + sbin/init-common-pre.sh | 2 + sbin/init-functions.sh | 19 ++- + sbin/init.linux.sh | 8 - + sbin/rc | 7 - + sbin/rc-daemon.sh | 12 + + sbin/rc-help.sh | 4 + sbin/rc-update | 2 + sbin/runscript.sh | 41 +++--- + src/Makefile | 2 + src/awk/genenviron.awk | 2 + src/core/ChangeLog.0 | 2 + tarball.sh | 2 + 52 files changed, 316 insertions(+), 174 deletions(-) + 22 Dec 2005; Christian Heim <phreak@gentoo.org>: Importing latest baselayout/trunk changes. This is a merge with revision 1768. diff --git a/bin/rc-status b/bin/rc-status index 299383c..2056800 100755 --- a/bin/rc-status +++ b/bin/rc-status @@ -90,7 +90,7 @@ if [[ -z ${runlevel} ]] ; then if [[ -e ${svcdir}/softlevel ]] ; then runlevel=$(<${svcdir}/softlevel) else - ewarn "Could not locate current runlevel in ${svcdir}/softlevel" + ewarn "Could not local current runlevel in ${svcdir}/softlevel" if [[ -d ${runleveldir}/default ]] ; then runlevel=default else diff --git a/etc/conf.d/domainname b/etc/conf.d/domainname index 7d8374b..3a32173 100644 --- a/etc/conf.d/domainname +++ b/etc/conf.d/domainname @@ -11,10 +11,10 @@ OVERRIDE=1 # # DNSDOMAIN merely sets the domain entry in /etc/resolv.conf, see # the resolv.conf(5) manpage for more info. - + DNSDOMAIN="" # For information on setting up NIS, please see: # http://www.linux-nis.org/nis-howto/HOWTO/ - + NISDOMAIN="" diff --git a/etc/profile b/etc/profile index 8655c73..f347430 100644 --- a/etc/profile +++ b/etc/profile @@ -57,11 +57,9 @@ else PS1="`whoami`@`uname -n | cut -f1 -d.` \$ " fi -if [ -d /etc/profile.d ] ; then - for sh in /etc/profile.d/*.sh ; do - if [ -r "$sh" ] ; then - . "$sh" - fi - done - unset sh -fi +for sh in /etc/profile.d/*.sh ; do + if [ -r "$sh" ] ; then + . "$sh" + fi +done +unset sh diff --git a/init.d/bootmisc b/init.d/bootmisc index 5cc2907..2350b0c 100755 --- a/init.d/bootmisc +++ b/init.d/bootmisc @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 depend() { diff --git a/init.d/domainname b/init.d/domainname index 5de43cd..f7ed8f9 100755 --- a/init.d/domainname +++ b/init.d/domainname @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 depend() { @@ -32,7 +32,7 @@ checkconfig_dns() { } start() { - # Ensure that we have a hostname binary or function + # Ensure that we have a hostname binary or function source /lib/rcscripts/net.modules.d/helpers.d/functions local retval=0 diff --git a/init.d/dummy b/init.d/dummy index de50a10..6017e5f 100755 --- a/init.d/dummy +++ b/init.d/dummy @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 start() { diff --git a/init.d/halt.sh b/init.d/halt.sh index d6a8174..117fc6f 100755 --- a/init.d/halt.sh +++ b/init.d/halt.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Write a reboot record to /var/log/wtmp before unmounting diff --git a/init.d/hostname b/init.d/hostname index 0037aab..c890b89 100755 --- a/init.d/hostname +++ b/init.d/hostname @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 start() { diff --git a/init.d/local b/init.d/local index 550c0f0..fb5e933 100755 --- a/init.d/local +++ b/init.d/local @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 depend() { diff --git a/init.d/reboot.sh b/init.d/reboot.sh index 559e51b..b1b7cb0 100755 --- a/init.d/reboot.sh +++ b/init.d/reboot.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 /sbin/reboot -d diff --git a/init.d/rmnologin b/init.d/rmnologin index 436fec3..cad2245 100755 --- a/init.d/rmnologin +++ b/init.d/rmnologin @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 start() { diff --git a/init.d/shutdown.sh b/init.d/shutdown.sh index 9099dc0..d3cde8f 100755 --- a/init.d/shutdown.sh +++ b/init.d/shutdown.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 /sbin/halt -d diff --git a/net-scripts/conf.d/net.example b/net-scripts/conf.d/net.example index e13a842..ebf1236 100644 --- a/net-scripts/conf.d/net.example +++ b/net-scripts/conf.d/net.example @@ -674,10 +674,10 @@ #} #postdown() { -# # Enable Wake-On-LAN for the interface +# # Enable Wake-On-LAN for every interface except for lo # # Probably a good idea to set RC_DOWN_INTERFACE="no" in /etc/conf.d/rc # # as well ;) -# ethtool -s "${IFACE}" wol g +# [[ ${IFACE} != "lo" ]] && ethtool -s "${IFACE}" wol g # # # Return 0 always # return 0 diff --git a/net-scripts/conf.d/wireless.example b/net-scripts/conf.d/wireless.example index 18e27b5..b50afdc 100644 --- a/net-scripts/conf.d/wireless.example +++ b/net-scripts/conf.d/wireless.example @@ -92,12 +92,18 @@ #channel_eth0="3" # Setup any other config commands. This is basically the iwconfig argument -# without the iwconfig $iface +# without the iwconfig $iface. #iwconfig_eth0="" # Set private driver ioctls. This is basically the iwpriv argument without -# the iwpriv $iface +# the iwpriv $iface. If you use the rt2500 driver (not the rt2x00 one) then +# you can set WPA here, below is an example. #iwpriv_eth0="" +#iwpriv_ESSID=( +# "set AuthMode=WPAPSK" +# "set EncrypType=TKIP" +# "set WPAPSK=yourpasskey" +#) # Seconds to wait before scanning # Some drivers need to wait until they have finished "loading" @@ -106,7 +112,7 @@ #sleep_scan_eth0="1" # Seconds to wait until associated. The default is to wait 10 seconds. -# 0 means wait indefinitely. WARNING : this can cause an infinite delay when +# 0 means wait indefinitely. WARNING: this can cause an infinite delay when # booting. #associate_timeout_eth0="5" diff --git a/net-scripts/init.d/net.lo b/net-scripts/init.d/net.lo index 2218475..47752cb 100755 --- a/net-scripts/init.d/net.lo +++ b/net-scripts/init.d/net.lo @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) @@ -504,7 +504,7 @@ modules_load() { iface_start() { local iface="$1" mod config_counter="-1" x config_worked=false local RC_INDENTATION="${RC_INDENTATION}" - local -a config fallback fallback_route conf a + local -a config fallback fallback_route conf a b local ifvar=$( bash_variable "$1" ) i j # Try and work out a metric for the interface if we're on auto @@ -530,14 +530,14 @@ iface_start() { a="config_${ifvar}[@]" a=( "${!a}" ) for (( i=0; i<${#a[@]}; i++ )); do - local -a b=( $( expand_parameters "${a[i]}" ) ) + eval b=( $( expand_parameters "${a[i]}" ) ) config=( "${config[@]}" "${b[@]}" ) done a="fallback_${ifvar}[@]" a=( "${!a}" ) for (( i=0; i<${#a[@]}; i++ )); do - local -a b=( $( expand_parameters "${a[i]}" ) ) + eval b=( $( expand_parameters "${a[i]}" ) ) fallback=( "${fallback[@]}" "${b[@]}" ) done @@ -770,8 +770,10 @@ run_start() { && eval "config_${IFVAR}=( "\"\$\{config\[@\]:1\}\"" )" # There may be existing ip address info - so we strip it - [[ ${RC_INTERFACE_KEEP_CONFIG} != "yes" ]] \ - && interface_del_addresses "${iface}" + if [[ ${RC_INTERFACE_KEEP_CONFIG} != "yes" \ + && ${IN_BACKGROUND} != "true" ]]; then + interface_del_addresses "${iface}" + fi # Start the interface if ! iface_start "${iface}" ; then diff --git a/net-scripts/net.modules.d/adsl b/net-scripts/net.modules.d/adsl index facf9fd..5175315 100644 --- a/net-scripts/net.modules.d/adsl +++ b/net-scripts/net.modules.d/adsl @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/apipa b/net-scripts/net.modules.d/apipa index 9e6bbfa..6be2858 100644 --- a/net-scripts/net.modules.d/apipa +++ b/net-scripts/net.modules.d/apipa @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/arping b/net-scripts/net.modules.d/arping index 110d458..3d178fa 100644 --- a/net-scripts/net.modules.d/arping +++ b/net-scripts/net.modules.d/arping @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/bonding b/net-scripts/net.modules.d/bonding index 7b44a5a..7e1cb3d 100644 --- a/net-scripts/net.modules.d/bonding +++ b/net-scripts/net.modules.d/bonding @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/bridge b/net-scripts/net.modules.d/bridge index 6780a18..6c77067 100644 --- a/net-scripts/net.modules.d/bridge +++ b/net-scripts/net.modules.d/bridge @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) @@ -131,22 +131,24 @@ bridge_pre_start() { if [[ -z ${!ports} && -n ${!briface} ]]; then ports="${iface}" iface="${!briface}" + else + ports="${!ports}" fi # Create the bridge if needed bridge_exists "${iface}" || bridge_create "${iface}" - if [[ -n ${!ports} ]]; then + if [[ -n ${ports} ]]; then einfo "Adding ports to ${iface}" eindent - for i in ${!ports}; do + for i in ${ports}; do interface_exists "${i}" && continue eerror "interface ${i} does not exist" return 1 done - for i in ${!ports}; do + for i in ${ports}; do ebegin "${i}" bridge_add_port "${iface}" "${i}" eend $? || return 1 diff --git a/net-scripts/net.modules.d/dhclient b/net-scripts/net.modules.d/dhclient index 91a751a..c97360a 100644 --- a/net-scripts/net.modules.d/dhclient +++ b/net-scripts/net.modules.d/dhclient @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/dhcpcd b/net-scripts/net.modules.d/dhcpcd index b7b942f..ab8f9dc 100644 --- a/net-scripts/net.modules.d/dhcpcd +++ b/net-scripts/net.modules.d/dhcpcd @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/essidnet b/net-scripts/net.modules.d/essidnet index fbb8b30..f2bd823 100644 --- a/net-scripts/net.modules.d/essidnet +++ b/net-scripts/net.modules.d/essidnet @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) @@ -41,7 +41,7 @@ essidnet_pre_start() { configure_variables "${iface}" "${essid}" "${mac}" # Backwards compat for old gateway var - x="gateway_${essid}}" + x="gateway_${essid}" [[ -n ${!x} ]] && gateway="${iface}/${!x}" veend 0 2>/dev/null diff --git a/net-scripts/net.modules.d/helpers.d/dhclient-wrapper b/net-scripts/net.modules.d/helpers.d/dhclient-wrapper index d857b6c..08a9433 100755 --- a/net-scripts/net.modules.d/helpers.d/dhclient-wrapper +++ b/net-scripts/net.modules.d/helpers.d/dhclient-wrapper @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) @@ -7,6 +7,9 @@ # Instead of writing new functions for dhclient, we simply map their variables # over to udhcpc style ones and call those scripts! +[[ -e /etc/dhcp/dhclient-enter-hooks ]] \ + && ( . /etc/dhcp/dhclient-enter-hooks ) + case "${reason}" in BOUND|REBOOT|REBIND) action="bound" ;; RENEW) action="renew" ;; diff --git a/net-scripts/net.modules.d/helpers.d/dhcp b/net-scripts/net.modules.d/helpers.d/dhcp index bb96565..35d6775 100755 --- a/net-scripts/net.modules.d/helpers.d/dhcp +++ b/net-scripts/net.modules.d/helpers.d/dhcp @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/helpers.d/dhcp-state b/net-scripts/net.modules.d/helpers.d/dhcp-state index 6c91bea..c5de21f 100644 --- a/net-scripts/net.modules.d/helpers.d/dhcp-state +++ b/net-scripts/net.modules.d/helpers.d/dhcp-state @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2005 Gentoo Foundation +# Copyright (c) 2005-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper b/net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper index f5e5a9c..5769103 100755 --- a/net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper +++ b/net-scripts/net.modules.d/helpers.d/dhcpcd-wrapper @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2005 Gentoo Foundation +# Copyright (c) 2005-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/helpers.d/functions b/net-scripts/net.modules.d/helpers.d/functions index a16cdb7..eebb55d 100644 --- a/net-scripts/net.modules.d/helpers.d/functions +++ b/net-scripts/net.modules.d/helpers.d/functions @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # We will be loaded after conf.d/rc and conf.d/net so we can set a default @@ -317,7 +317,7 @@ merge_configs() { # Selects the best interface to apply state information to # This is currently based on routing metrics select_best_interface() { - local -a ifs=( $(order_interfaces true) ) + local -a ifs=( $(order_interfaces) ) # Move lo to the back of the pecking order of it's active local x=" ${ifs[@]} " diff --git a/net-scripts/net.modules.d/helpers.d/module-loader b/net-scripts/net.modules.d/helpers.d/module-loader index 3fac7bf..fe6d1df 100644 --- a/net-scripts/net.modules.d/helpers.d/module-loader +++ b/net-scripts/net.modules.d/helpers.d/module-loader @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) @@ -10,7 +10,9 @@ MODULES_DIR="${svclib}/net.modules.d" . "${MODULES_DIR}/system" . "${MODULES_DIR}/helpers.d/functions" -conf=$(add_suffix "/etc/conf.d/net") +conf="$(add_suffix /etc/conf.d/net)" +[[ -e ${conf} ]] && source "${conf}" +conf="$(add_suffix /etc/conf.d/net.${interface})" [[ -e ${conf} ]] && source "${conf}" # Create some dummy functions, so we can depend on a module diff --git a/net-scripts/net.modules.d/helpers.d/pppd-wrapper b/net-scripts/net.modules.d/helpers.d/pppd-wrapper index 829d0be..63a868a 100644 --- a/net-scripts/net.modules.d/helpers.d/pppd-wrapper +++ b/net-scripts/net.modules.d/helpers.d/pppd-wrapper @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2005 Gentoo Foundation +# Copyright (c) 2005-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/helpers.d/pump-wrapper b/net-scripts/net.modules.d/helpers.d/pump-wrapper index 2a3dacc..fec705c 100755 --- a/net-scripts/net.modules.d/helpers.d/pump-wrapper +++ b/net-scripts/net.modules.d/helpers.d/pump-wrapper @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2005 Gentoo Foundation +# Copyright (c) 2005-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/helpers.d/udhcpc-wrapper b/net-scripts/net.modules.d/helpers.d/udhcpc-wrapper index ba317e5..3edab95 100755 --- a/net-scripts/net.modules.d/helpers.d/udhcpc-wrapper +++ b/net-scripts/net.modules.d/helpers.d/udhcpc-wrapper @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) diff --git a/net-scripts/net.modules.d/iproute2 b/net-scripts/net.modules.d/iproute2 index f734e77..cff83e2 100644 --- a/net-scripts/net.modules.d/iproute2 +++ b/net-scripts/net.modules.d/iproute2 @@ -139,6 +139,7 @@ iproute2_del_addresses() { local pre="" ${2:-false} && pre="-f inet" ip ${pre} addr flush label "$1" scope global &>/dev/null + ip ${pre} addr flush label "$1" scope site &>/dev/null ip ${pre} addr flush label "$1" scope host &>/dev/null return 0 } diff --git a/net-scripts/net.modules.d/iwconfig b/net-scripts/net.modules.d/iwconfig index 3f1eb22..232cf0a 100644 --- a/net-scripts/net.modules.d/iwconfig +++ b/net-scripts/net.modules.d/iwconfig @@ -68,7 +68,8 @@ iwconfig_get_wep_status() { if [[ -n ${key} ]]; then status="enabled" - mode=" - $( iwconfig "$1" | sed -n -e 's/^.*Security mode:\(.*[^ ]\).*/\1/p' )" + mode="$( iwconfig $1 | sed -n -e 's/^.*Security mode:\(.*[^ ]\).*/\1/p' )" + [[ -n ${mode} ]] && mode=" - ${mode}" fi echo "(WEP ${status}${mode})" @@ -81,7 +82,7 @@ iwconfig_get_essid() { local i essid for (( i=0; i<5; i++ )); do - essid=$( iwgetid "$1" 2>/dev/null | sed -n -e 's/^.*ESSID:"\(.*\)"$/\1/p' ) + essid="$( iwgetid $1 2>/dev/null | sed -n -e 's/^.*ESSID:"\(.*\)"$/\1/p' )" if [[ -n ${essid} ]]; then echo "${essid}" return 0 @@ -152,27 +153,34 @@ iwconfig_get_wep_key() { echo "${!key:-off}" } -# void iwconfig_user_config(char *iface) +# void iwconfig_user_config(char *iface, char *ifvar) # # Applies the user configuration to the interface iwconfig_user_config() { - local iface="$1" conf ifvar=$( bash_variable "$1" ) + local iface="$1" conf aconf ifvar="$2" + [[ -z ${ifvar} ]] && ifvar=$( bash_variable "$1" ) # Apply the user configuration conf="iwconfig_${ifvar}" if [[ -n ${!conf} ]]; then - if ! eval iwconfig "${iface}" "${!conf}" ; then - ewarn "${iface} does not support the following configuration commands" - eval ewarn " ${!conf}" - fi + aconf=( "${!conf} ") + for conf in "${aconf[@]}" ; do + if ! eval iwconfig "${iface}" "${conf}" ; then + ewarn "${iface} does not support the following configuration commands" + ewarn " ${conf}" + fi + done fi - conf="iwpriv_${ifvar}" + conf="iwpriv_${ifvar}[@]" if [[ -n ${!conf} ]]; then - if ! eval iwpriv "${iface}" "${!conf}" ; then - ewarn "${iface} does not support the following private ioctls" - ewarn " ${!conf}" - fi + aconf=( "${!conf}" ) + for conf in "${aconf[@]}" ; do + if ! eval iwpriv "${iface}" "${conf}" ; then + ewarn "${iface} does not support the following private ioctls" + ewarn " ${conf}" + fi + done fi } @@ -217,6 +225,8 @@ iwconfig_setup_specific() { fi fi + iwconfig_user_config "${iface}" "${ESSIDVAR}" + # Finally set the ESSID if ! iwconfig "${iface}" essid "${ESSID}" ; then eerror "${iface} does not support setting ESSID to \"${dessid}\"" @@ -224,7 +234,6 @@ iwconfig_setup_specific() { fi iwconfig "${iface}" nick "${ESSID}" 2>/dev/null - iwconfig_user_config "${iface}" iwconfig_report "${iface}" return 0 @@ -331,12 +340,11 @@ iwconfig_associate() { ESSIDVAR=$( bash_variable "${ESSID}" ) key=$( iwconfig_get_wep_key "${mac}" ) if [[ ${wep_required} == "on" && ${key} == "off" ]]; then - vewarn "WEP key is not set for \"${dessid}\" - not connecting" - return 1 + ewarn "WEP key is not set for \"${dessid}\"" fi if [[ ${wep_required} == "off" && ${key} != "off" ]]; then key="off" - vewarn "\"${dessid}\" is not WEP enabled - ignoring setting" + ewarn "\"${dessid}\" is not WEP enabled - ignoring setting" fi if ! eval iwconfig "${iface}" key "${key}" ; then @@ -349,6 +357,8 @@ iwconfig_associate() { [[ ${key} != "off" ]] && w=$( iwconfig_get_wep_status "${iface}" ) fi + iwconfig_user_config "${iface}" "${ESSIDVAR}" + if ! iwconfig "${iface}" essid "${ESSID}" ; then if [[ ${ESSID} != "any" ]]; then ewarn "${iface} does not support setting ESSID to \"${dessid}\"" @@ -382,7 +392,6 @@ iwconfig_associate() { return $? fi - iwconfig_user_config "${iface}" iwconfig_report "${iface}" if is_function postassociate ; then diff --git a/net-scripts/net.modules.d/wpa_supplicant b/net-scripts/net.modules.d/wpa_supplicant index 2e0f1c4..8458c0f 100644 --- a/net-scripts/net.modules.d/wpa_supplicant +++ b/net-scripts/net.modules.d/wpa_supplicant @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2004-2005 Gentoo Foundation +# Copyright (c) 2004-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Contributed by Roy Marples (uberlord@gentoo.org) @@ -58,7 +58,7 @@ wpa_supplicant_get_essid() { local i essid for (( i=0; i<5; i++ )); do - essid=$( wpa_cli -i"$1" status | sed -n -e 's/^ssid=//p' ) + essid="$( wpa_cli -i$1 status | sed -n -e 's/^ssid=//p' )" if [[ -n ${essid} ]]; then echo "${essid}" return 0 @@ -83,10 +83,11 @@ wpa_supplicant_get_ap_mac_address() { # Note that just because we are associated does not mean we are using the # correct encryption keys wpa_supplicant_associated() { - local -a status=( "$( wpa_cli -i"$1" status | sed -n -e 's/^\(key_mgmt\|wpa_state\|EAP state\)=\([^=]\+\).*/\U\2/p' )" ) + local -a status + eval status=( $( wpa_cli -i"$1" status | sed -n -e 's/^\(key_mgmt\|wpa_state\|EAP state\)=\([^=]\+\).*/\U\"\2\"/p' ) ) case "${status[0]}" in - "NONE") [[ ${status[1]} == "ASSOCIATED" ]] ;; + "NONE") [[ ${status[1]} == "ASSOCIATED" || ${status[1]} == "COMPLETED" ]] ;; "IEEE 802.1X (no WPA)") [[ ${status[2]} == "SUCCESS" ]] ;; *) [[ ${status[1]} == "COMPLETED" ]] ;; esac @@ -310,7 +311,8 @@ wpa_supplicant_pre_start() { ESSIDVAR=$( bash_variable "${ESSID}" ) save_options "ESSID" "${ESSID}" - local -a status=( "$( wpa_cli -i${iface} status | sed -n -e 's/^\(bssid\|pairwise_cipher\|key_mgmt\)=\([^=]\+\).*/\"\U\2\"/p' | tr '[:lower:]' '[:upper:]' )" ) + local -a status + eval status=( $( wpa_cli -i"${iface}" status | sed -n -e 's/^\(bssid\|pairwise_cipher\|key_mgmt\)=\([^=]\+\).*/\"\U\2\"/p' | tr '[:lower:]' '[:upper:]' ) ) einfo "${iface} connected to \"${ESSID//\\\\/\\\\}\" at ${status[0]}" if [[ ${status[2]} == "NONE" ]]; then diff --git a/sbin/MAKEDEV b/sbin/MAKEDEV index a826c33..10bdaa3 100755 --- a/sbin/MAKEDEV +++ b/sbin/MAKEDEV @@ -561,7 +561,7 @@ do symlink mouse sunmouse makedev openprom c 10 139 root root 0664 ;; - generic-vserver) + generic-vps) makedev null c 1 3 $public makedev zero c 1 5 $public makedev full c 1 7 $public @@ -577,6 +577,7 @@ do makedev ttyp$i c 3 $i $tty done ;; + generic-*) echo "$0: no support for generic on this arch" >&2 exit 1 diff --git a/sbin/functions.sh b/sbin/functions.sh index dc7997f..ea09893 100755 --- a/sbin/functions.sh +++ b/sbin/functions.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 RC_GOT_FUNCTIONS="yes" @@ -108,7 +108,7 @@ setup_defaultlevels() { if [[ -f "${svcdir}/softlevel" ]] ; then export SOFTLEVEL=$(< "${svcdir}/softlevel") else - export SOFTLEVEL=${BOOTLEVEL} + export SOFTLEVEL="${BOOTLEVEL}" fi fi @@ -121,7 +121,7 @@ setup_defaultlevels() { # get_libdir() { if [[ -n ${CONF_LIBDIR_OVERRIDE} ]] ; then - CONF_LIBDIR=${CONF_LIBDIR_OVERRIDE} + CONF_LIBDIR="${CONF_LIBDIR_OVERRIDE}" elif [[ -x /usr/bin/portageq ]] ; then CONF_LIBDIR=$(/usr/bin/portageq envvar CONF_LIBDIR) fi @@ -137,8 +137,8 @@ esyslog() { local tag= if [[ -x /usr/bin/logger ]] ; then - pri=$1 - tag=$2 + pri="$1" + tag="$2" shift 2 [[ -z "$*" ]] && return 0 @@ -154,7 +154,7 @@ esyslog() { # increase the indent used for e-commands. # eindent() { - local i=$1 + local i="$1" (( i > 0 )) || (( i = RC_DEFAULT_INDENT )) esetdent $(( ${#RC_INDENTATION} + i )) } @@ -164,7 +164,7 @@ eindent() { # decrease the indent used for e-commands. # eoutdent() { - local i=$1 + local i="$1" (( i > 0 )) || (( i = RC_DEFAULT_INDENT )) esetdent $(( ${#RC_INDENTATION} - i )) } @@ -175,7 +175,7 @@ eoutdent() { # num defaults to 0 # esetdent() { - local i=$1 + local i="$1" (( i < 0 )) && (( i = 0 )) RC_INDENTATION=$(printf "%${i}s" '') } @@ -471,7 +471,7 @@ dolisting() { # save the settings ("optstring") for "option" # save_options() { - local myopts=$1 + local myopts="$1" shift if [[ ! -d "${svcdir}/options/${myservice}" ]] ; then @@ -502,6 +502,7 @@ get_options() { # appended to it. For use with multi-config services. add_suffix() { echo "$1" + return 0 } @@ -529,7 +530,7 @@ NET_FS_LIST="afs cifs coda davfs gfs ncpfs nfs nfs4 ocfs2 shfs smbfs" is_net_fs() { local fstype # /proc/mounts is always accurate - fstype=$( sed -n -e '/^rootfs/!s:.* '"$1"' \([^ ]*\).*:\1:p' /proc/mounts ) + fstype=$( mount | sed -n -e 's:.* on '"$1"' type \([^ ]*\).*:\1:p' ) [[ " ${NET_FS_LIST} " == *" ${fstype} "* ]] return $? } @@ -591,7 +592,7 @@ reverse_list() { # Starts addon. # start_addon() { - local addon=$1 + local addon="$1" (import_addon "${addon}-start.sh") return 0 } @@ -630,7 +631,7 @@ stop_volumes() { # EXAMPLE: if is_older_than a.out *.o ; then ... is_older_than() { local x= - local ref=$1 + local ref="$1" shift for x in "$@" ; do @@ -708,7 +709,7 @@ else # Should we use colors ? if [[ $* != *depend* ]] ; then # Check user pref in portage - RC_NOCOLOR=$(portageq envvar NOCOLOR 2>/dev/null) + RC_NOCOLOR="$(portageq envvar NOCOLOR 2>/dev/null)" [[ ${RC_NOCOLOR} == "true" ]] && RC_NOCOLOR="yes" else # We do not want colors during emerge depend @@ -724,7 +725,7 @@ if [[ -n ${EBUILD} && $* == *depend* ]] ; then else # Setup COLS and ENDCOL so eend can line up the [ ok ] COLS=${COLUMNS:-0} # bash's internal COLUMNS variable - (( COLS == 0 )) && COLS=$(stty size 2>/dev/null | cut -d' ' -f2) + (( COLS == 0 )) && COLS=$(set -- `stty size 2>/dev/null` ; echo $2) (( COLS > 0 )) || (( COLS = 80 )) # width of [ ok ] == 7 fi diff --git a/sbin/init-common-post.sh b/sbin/init-common-post.sh index 5d4e102..2537b21 100755 --- a/sbin/init-common-post.sh +++ b/sbin/init-common-post.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # We set the forced softlevel from the kernel command line diff --git a/sbin/init-common-pre.sh b/sbin/init-common-pre.sh index 5c4ef4c..3795498 100755 --- a/sbin/init-common-pre.sh +++ b/sbin/init-common-pre.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Setup initial $PATH just in case diff --git a/sbin/init-functions.sh b/sbin/init-functions.sh index 04a1f13..2cf46b9 100755 --- a/sbin/init-functions.sh +++ b/sbin/init-functions.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # bool check_statedir(dir) @@ -40,14 +40,21 @@ start_critical_service() { # Needed for some addons like dm-crypt that starts in critical services local myservice=$1 - source "/etc/init.d/${service}" || eerror "Failed to source /etc/init.d/${service}" + source "/etc/init.d/${service}" retval=$? - [[ ${retval} -ne 0 ]] && return "${retval}" - [[ -e /etc/conf.d/${service} ]] && source "/etc/conf.d/${service}" - source /etc/rc.conf + if [[ ${retval} -ne 0 ]]; then + eerror "Failed to source /etc/init.d/${service}" + return "${retval}" + fi - start || eerror "Failed to start /etc/init.d/${service}" + local conf="$(add_suffix /etc/conf.d/${service})" + [[ -e ${conf} ]] && source "${conf}" + conf="$(add_suffix /etc/rc.conf)" + [[ -e ${conf} ]] && source "${conf}" + + start retval=$? + [[ ${retval} -ne 0 ]] && eerror "Failed to start /etc/init.d/${service}" return "${retval}" ) diff --git a/sbin/init.linux.sh b/sbin/init.linux.sh index ca4fca5..6c37cd6 100755 --- a/sbin/init.linux.sh +++ b/sbin/init.linux.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # void single_user() @@ -15,7 +15,7 @@ source "${svclib}"/sh/init-common-pre.sh echo echo -e "${GOOD}Gentoo Linux${GENTOO_VERS}; ${BRACKET}http://www.gentoo.org/${NORMAL}" -echo -e " Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2" +echo -e " Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2" echo echo -e "Press ${GOOD}I${NORMAL} to enter interactive boot mode" echo @@ -32,12 +32,12 @@ fi if [[ ! -e /dev/pts/0 ]]; then have_devpts="$(awk '($2 == "devpts") { print "yes"; exit 0 }' /proc/filesystems)" - if [ "${have_devpts}" = "yes" ]; then + if [ "${have_devpts}" = "yes" ] ; then # Make sure we have /dev/pts mkdir -p /dev/pts &>/dev/null || \ ewarn "Could not create /dev/pts!" - if [[ -d /dev/pts ]]; then + if [[ -d /dev/pts ]] ; then ebegin "Mounting devpts at /dev/pts" mount -n -t devpts -o gid=5,mode=0620 devpts /dev/pts eend $? @@ -1,5 +1,5 @@ #!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 trap ":" INT QUIT TSTP @@ -235,12 +235,12 @@ if [[ ${SOFTLEVEL} == "reboot" || ${SOFTLEVEL} == "shutdown" ]] ; then # should help speed things up a bit rm -rf $(ls -d1 "${svcdir}/"* 2>/dev/null | \ grep -ve '\(depcache\|deptree\|envcache\)') - + # Need try(), etc source "${svclib}"/sh/init-functions.sh source /etc/init.d/halt.sh - + if [[ ${SOFTLEVEL} == "reboot" ]] ; then source /etc/init.d/reboot.sh else @@ -296,5 +296,4 @@ rm -rf "${svcdir}/failed" &>/dev/null # Remove the cached CONSOLETYPE unset CONSOLETYPE - # vim:ts=4 diff --git a/sbin/rc-daemon.sh b/sbin/rc-daemon.sh index 8ef6bc6..51fc834 100755 --- a/sbin/rc-daemon.sh +++ b/sbin/rc-daemon.sh @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # RC functions to work with daemons @@ -35,6 +35,8 @@ RC_WAIT_ON_START="0.1" # Proccess vars - makes things easier by using the shift command # and indirect variables rc_shift_args() { + local addvar + while [[ $# != "0" ]]; do if [[ $1 != "-"* && -n ${addvar} ]]; then if [[ -z ${!addvar} ]]; then @@ -95,7 +97,7 @@ rc_setup_daemon_vars() { local x="${args// \'--\' /}" [[ ${x} != "${args}" ]] && eargs=( "${args##* \'--\' }" ) - rc_shift_args ${sargs[@]} + eval rc_shift_args "${sargs[@]}" [[ -z ${cmd} ]] && cmd="${name}" @@ -224,7 +226,7 @@ is_daemon_running() { read pid < "${pidfile}" pids=" ${pids} " - [[ ${pids// ${pid} } != "${pids}" ]] + [[ ${pids// ${pid} /} != "${pids}" ]] } # int rc_start_daemon(void) @@ -276,9 +278,9 @@ rc_stop_daemon() { # Check that the given program is actually running the pid if [[ -n ${pids} ]]; then pids=" ${pids} " - [[ ${pids// ${pid} } == ${pids} ]] && return 1 + [[ ${pids// ${pid} /} == "${pids}" ]] && return 1 fi - pids=${pid} + pids="${pid}" fi # If there's nothing to kill then return without error diff --git a/sbin/rc-help.sh b/sbin/rc-help.sh index 214c19d..1799d96 100755 --- a/sbin/rc-help.sh +++ b/sbin/rc-help.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 source /sbin/functions.sh @@ -40,7 +40,7 @@ extra_opts=$(source "${myscript}" 2>/dev/null ; echo ${opts}) if [[ ${BE_VERBOSE} == "yes" ]] ; then echo -e " ${GREEN}Gentoo RC-Scripts; ${BLUE}http://www.gentoo.org/${OFF} - Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL + Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL " fi diff --git a/sbin/rc-update b/sbin/rc-update index a4150f8..3f9a980 100755 --- a/sbin/rc-update +++ b/sbin/rc-update @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 source /sbin/functions.sh diff --git a/sbin/runscript.sh b/sbin/runscript.sh index 67626ed..ce1d1e9 100755 --- a/sbin/runscript.sh +++ b/sbin/runscript.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Common functions @@ -19,20 +19,20 @@ fi svcpause="no" svcrestart="no" -myscript=$1 +myscript="$1" if [[ -L $1 && ! -L /etc/init.d/${1##*/} ]] ; then - myservice=$(readlink "$1") + myservice="$(readlink $1)" else - myservice=$1 + myservice="$1" fi -myservice=${myservice##*/} -export SVCNAME=${myservice} -mylevel=$(<"${svcdir}/softlevel") +myservice="${myservice##*/}" +export SVCNAME="${myservice}" +mylevel="$(<${svcdir}/softlevel)" # Set $IFACE to the name of the network interface if it is a 'net.*' script if [[ ${myservice%%.*} == "net" && ${myservice##*.} != "${myservice}" ]] ; then - IFACE=${myservice##*.} + IFACE="${myservice##*.}" NETSERVICE="yes" else IFACE= @@ -40,22 +40,25 @@ else fi # Check if the textdomain is non-default -search_lang=${LC_ALL:-${LC_MESSAGES:-${LANG}}} +search_lang="${LC_ALL:-${LC_MESSAGES:-${LANG}}}" [[ -f ${TEXTDOMAINDIR}/${search_lang%.*}/LC_MESSAGES/${myservice}.mo ]] \ - && TEXTDOMAIN=${myservice} + && TEXTDOMAIN="${myservice}" # Source configuration files. -# (1) Source /etc/conf.d/${myservice} to get initscript-specific +# (1) Source /etc/conf.d/net if it is a net.* service +# (2) Source /etc/conf.d/${myservice} to get initscript-specific # configuration (if it exists). -# (2) Source /etc/conf.d/net if it is a net.* service # (3) Source /etc/rc.conf to pick up potentially overriding # configuration, if the system administrator chose to put it # there (if it exists). - -[[ -e $(add_suffix /etc/conf.d/${myservice}) ]] && source "$(add_suffix /etc/conf.d/${myservice})" -[[ -e $(add_suffix /etc/conf.d/net) ]] && \ -[[ ${NETSERVICE} == "yes" ]] && source "$(add_suffix /etc/conf.d/net)" -[[ -e $(add_suffix /etc/rc.conf) ]] && source "$(add_suffix /etc/rc.conf)" +if [[ ${NETSERVICE} == "yes" ]]; then + conf="$(add_suffix /etc/conf.d/net)" + [[ -e ${conf} ]] && source "${conf}" +fi +conf="$(add_suffix /etc/conf.d/${myservice})" +[[ -e ${conf} ]] && source "${conf}" +conf="$(add_suffix /etc/rc.conf)" +[[ -e ${conf} ]] && source "${conf}" usage() { local IFS="|" @@ -132,7 +135,7 @@ svc_stop() { mydeps="${mydeps} ${myservice}" else - mydeps=${myservice} + mydeps="${myservice}" fi fi @@ -302,7 +305,7 @@ svc_start() { $(dolisting "/etc/runlevels/${mylevel}/net.*")" for y in ${netservices} ; do - mynetservice=${y##*/} + mynetservice="${y##*/}" if service_stopped "${mynetservice}" ; then start_service "${mynetservice}" fi diff --git a/src/Makefile b/src/Makefile index 252dea0..f27a57a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header$ diff --git a/src/awk/genenviron.awk b/src/awk/genenviron.awk index 3ba5333..2e320cb 100644 --- a/src/awk/genenviron.awk +++ b/src/awk/genenviron.awk @@ -1,4 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 BEGIN { diff --git a/src/core/ChangeLog b/src/core/AUTHORS index e69de29..e69de29 100644 --- a/src/core/ChangeLog +++ b/src/core/AUTHORS diff --git a/src/core/ChangeLog.0 b/src/core/ChangeLog.0 index 5d0754a..a160e7c 100644 --- a/src/core/ChangeLog.0 +++ b/src/core/ChangeLog.0 @@ -1,5 +1,5 @@ # ChangeLog for Gentoo System Intialization core utilities. -# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPLv2 +# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2 # $Header$ 20 Sep 2005 Martin Schlemmer <azarah@gentoo.org> diff --git a/src/core/Makefile b/src/core/NEWS index e69de29..e69de29 100644 --- a/src/core/Makefile +++ b/src/core/NEWS diff --git a/src/core/debug.h b/src/core/debug.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/debug.h +++ /dev/null diff --git a/src/core/depend.c b/src/core/depend.c deleted file mode 100644 index e69de29..0000000 --- a/src/core/depend.c +++ /dev/null diff --git a/src/core/depend.h b/src/core/depend.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/depend.h +++ /dev/null diff --git a/src/core/depscan.c b/src/core/depscan.c deleted file mode 100644 index e69de29..0000000 --- a/src/core/depscan.c +++ /dev/null diff --git a/src/core/librcscripts/debug.h b/src/core/librcscripts/debug.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/librcscripts/debug.h +++ /dev/null diff --git a/src/core/librcscripts/depend.h b/src/core/librcscripts/depend.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/librcscripts/depend.h +++ /dev/null diff --git a/src/core/librcscripts/list.h b/src/core/librcscripts/list.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/librcscripts/list.h +++ /dev/null diff --git a/src/core/librcscripts/misc.h b/src/core/librcscripts/misc.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/librcscripts/misc.h +++ /dev/null diff --git a/src/core/librcscripts/parse.h b/src/core/librcscripts/parse.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/librcscripts/parse.h +++ /dev/null diff --git a/src/core/librcscripts/simple-regex.h b/src/core/librcscripts/simple-regex.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/librcscripts/simple-regex.h +++ /dev/null diff --git a/src/core/list.h b/src/core/list.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/list.h +++ /dev/null diff --git a/src/core/misc.c b/src/core/misc.c deleted file mode 100644 index e69de29..0000000 --- a/src/core/misc.c +++ /dev/null diff --git a/src/core/misc.h b/src/core/misc.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/misc.h +++ /dev/null diff --git a/src/core/parse.c b/src/core/parse.c deleted file mode 100644 index e69de29..0000000 --- a/src/core/parse.c +++ /dev/null diff --git a/src/core/parse.h b/src/core/parse.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/parse.h +++ /dev/null diff --git a/src/core/simple-regex.c b/src/core/simple-regex.c deleted file mode 100644 index e69de29..0000000 --- a/src/core/simple-regex.c +++ /dev/null diff --git a/src/core/simple-regex.h b/src/core/simple-regex.h deleted file mode 100644 index e69de29..0000000 --- a/src/core/simple-regex.h +++ /dev/null diff --git a/src/core/test-regex.c b/src/core/test-regex.c deleted file mode 100644 index e69de29..0000000 --- a/src/core/test-regex.c +++ /dev/null @@ -1,7 +1,7 @@ #!/bin/bash export TMP="${TMP:-/tmp}" export V="1.13.0" -export NAME="baselayout-vserver" +export NAME="baselayout" export DEST="${TMP}/${NAME}-${V}" if [[ $1 != "-f" ]] ; then |