From 8aff6add70fd50b3febe363a0002098f21e2679b Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Fri, 11 Mar 2005 20:02:08 +0000 Subject: added support for backgrounding daemons at startup with a '@' prefix, commented out the ldconfig call at startup, added support for unicode console maps, added a hotplug_ifup() function rc.d/network for hotplug's net.agent to use --- functions | 7 +++++++ network | 15 ++++++++++++++- rc.conf | 5 ++++- rc.multi | 7 ++++++- rc.shutdown | 2 +- rc.single | 2 +- rc.sysinit | 10 +++++++--- 7 files changed, 40 insertions(+), 8 deletions(-) diff --git a/functions b/functions index ec3e986..347c4de 100644 --- a/functions +++ b/functions @@ -16,6 +16,7 @@ if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then C_BUSY="\033[0;36m" # busy C_FAIL="\033[1;31m" # failed C_DONE="\033[1;37m" # completed + C_BKGD="\033[1;35m" # backgrounded C_H1="\033[1;37m" # highlight text 1 C_H2="\033[1;36m" # highlight text 2 @@ -42,6 +43,12 @@ printsep() { echo -e "\n$C_SEPARATOR ------------------------------\n" } +stat_bkgd() { + echo -ne "$C_OTHER$PREFIX_REG $C_MAIN$1$C_CLEAR " + deltext + echo -ne " $C_OTHER[${C_BKGD}BKGD$C_OTHER]$C_CLEAR " +} + stat_busy() { echo -ne "$C_OTHER$PREFIX_REG $C_MAIN$1$C_CLEAR " deltext diff --git a/network b/network index d10c2ad..1513c58 100755 --- a/network +++ b/network @@ -12,6 +12,19 @@ # look for dhcpcd settings [ -f /etc/conf.d/dhcpcd ] && . /etc/conf.d/dhcpcd +# Special wrapper for hotplug ifup calls +# (make sure hotplug doesn't bring up disabled interfaces) +hotplug_ifup() +{ + [ "$1" != "" ] || return 1 + for ifline in ${INTERFACES[@]}; do + # if the interface is disabled then this will be skipped + if [ "$ifline" = "$1" ]; then + ifup $ifline + fi + done +} + ifup() { if [ "$1" = "" ]; then @@ -173,7 +186,7 @@ case "$1" in /bin/sleep 2 $0 start ;; - ifup|ifdown|iflist|rtup|rtdown|rtlist) + hotplug_ifup|ifup|ifdown|iflist|rtup|rtdown|rtlist) $1 $2 ;; *) diff --git a/rc.conf b/rc.conf index d4718e9..9063a91 100644 --- a/rc.conf +++ b/rc.conf @@ -8,13 +8,15 @@ # HARDWARECLOCK: set to "UTC" or "localtime" # TIMEZONE: timezones are found in /usr/share/zoneinfo # KEYMAP: keymaps are found in /usr/share/kbd/keymaps -# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-us) +# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US) +# CONSOLEMAP: found in /usr/share/kbd/unimaps # USECOLOR: use ANSI color sequences in startup messages # HARDWARECLOCK="localtime" TIMEZONE=Canada/Pacific KEYMAP=us CONSOLEFONT= +CONSOLEMAP= USECOLOR="yes" # Scan for LVM volume groups at startup, required if you use LVM @@ -53,6 +55,7 @@ ROUTES=(!gateway) # # Daemons to start at boot-up (in this order) # (prefix a daemon with a ! to disable it) +# (prefix a daemon with a @ to start it up in the background) # DAEMONS=(syslog-ng hotplug !pcmcia network netfs crond) diff --git a/rc.multi b/rc.multi index e33226e..3f34941 100755 --- a/rc.multi +++ b/rc.multi @@ -9,7 +9,12 @@ # Start daemons for daemon in "${DAEMONS[@]}"; do if [[ `echo $daemon | grep '^[^\!]' | wc -l` -eq 1 ]]; then - /etc/rc.d/$daemon start + if [[ `echo $daemon | grep '^[^\@]' | wc -l` -eq 1 ]]; then + /etc/rc.d/$daemon start + else + stat_bkgd "Starting ${daemon:1}" + (/etc/rc.d/${daemon:1} start) &>/dev/null & + fi fi done diff --git a/rc.shutdown b/rc.shutdown index 98316d2..b18699d 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -18,7 +18,7 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then let i=${#DAEMONS[@]} while [[ i -ge 0 ]]; do if [[ `echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l` -eq 1 ]]; then - /etc/rc.d/${DAEMONS[$i]} stop + /etc/rc.d/${DAEMONS[$i]#@} stop fi let i=i-1 done diff --git a/rc.single b/rc.single index baffd91..0634e6f 100755 --- a/rc.single +++ b/rc.single @@ -11,7 +11,7 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then let i=${#DAEMONS[@]} while [[ i -gt 0 ]]; do if [[ `echo ${DAEMONS[$i]} | grep '^[^\!]' | wc -l` -eq 1 ]]; then - /etc/rc.d/${DAEMONS[$i]} stop + /etc/rc.d/${DAEMONS[$i]#@} stop fi let i=i-1 done diff --git a/rc.sysinit b/rc.sysinit index cb8c4fc..fdb6a44 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -121,7 +121,7 @@ mkdir /tmp/.ICE-unix && chmod 1777 /tmp/.ICE-unix mkdir /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix stat_done -status "Updating Shared Library Links" /sbin/ldconfig +#status "Updating Shared Library Links" /sbin/ldconfig if [ "$HOSTNAME" != "" ]; then status "Setting Hostname: $HOSTNAME" /bin/hostname $HOSTNAME @@ -140,9 +140,13 @@ if [ "$KEYMAP" != "" ]; then fi if [ "$CONSOLEFONT" != "" ]; then - stat_busy "Loading Console Font: $CONSOLEFONT" + stat_busy "Loading Console Font: $CONSOLEFONT" for i in `seq 1 12`; do - /usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i}; + if [ "$CONSOLEMAP" != "" ]; then + /usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/vc/${i}; + else + /usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i}; + fi done stat_done fi -- cgit v1.2.3