diff options
-rw-r--r-- | initscripts.spec | 19 | ||||
-rw-r--r-- | po/Makefile | 2 | ||||
-rwxr-xr-x | rc.d/init.d/functions | 114 | ||||
-rwxr-xr-x | rc.d/init.d/halt | 25 | ||||
-rwxr-xr-x | rc.d/init.d/netfs | 30 | ||||
-rwxr-xr-x | rc.d/init.d/network | 18 | ||||
-rwxr-xr-x | rc.d/init.d/random | 8 | ||||
-rwxr-xr-x | rc.d/init.d/rawdevices | 26 | ||||
-rwxr-xr-x | rc.d/init.d/single | 8 | ||||
-rwxr-xr-x | rc.d/rc | 10 | ||||
-rwxr-xr-x | rc.d/rc.sysinit | 69 | ||||
-rwxr-xr-x | service | 8 | ||||
-rwxr-xr-x | setsysfont | 2 | ||||
-rwxr-xr-x | src/testdinit | 10 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifdown | 8 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifdown-aliases | 4 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup | 18 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-aliases | 18 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-ipx | 2 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-ppp | 16 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-routes | 4 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-sl | 16 |
22 files changed, 192 insertions, 243 deletions
diff --git a/initscripts.spec b/initscripts.spec index 0e2c314b..350f4398 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -1,6 +1,6 @@ Summary: The inittab file and the /etc/init.d scripts. Name: initscripts -Version: 5.56 +Version: 5.57 Copyright: GPL Group: System Environment/Base Release: 1 @@ -11,7 +11,7 @@ Requires: procps >= 2.0.6-5, sysklogd >= 1.3.31 Requires: setup >= 2.0.3, /sbin/fuser, which Requires: modutils >= 2.3.11-5 Requires: util-linux >= 2.10 -Requires: gettext >= 0.10.35-25 +Requires: bash >= 2.0 Conflicts: kernel <= 2.2, timeconfig < 3.0, pppd < 2.3.9, wvdial < 1.40-3 Conflicts: initscripts < 1.22.1-5 ypbind < 1.6-12 Obsoletes: rhsound sapinit @@ -72,25 +72,24 @@ mkdir -p $RPM_BUILD_ROOT/var/{log,run} touch $RPM_BUILD_ROOT/var/run/utmp touch $RPM_BUILD_ROOT/var/log/wtmp -# Put this stuff in /etc/locale too -mkdir -p $RPM_BUILD_ROOT/etc/locale -cp -a $RPM_BUILD_ROOT/usr/share/locale/* $RPM_BUILD_ROOT/etc/locale +# Put this stuff in /usr/share/locale too +mkdir -p $RPM_BUILD_ROOT/usr/share/locale +cp -a $RPM_BUILD_ROOT/etc/locale/* $RPM_BUILD_ROOT/usr/share/locale/ pushd %{buildroot}/%{_datadir}/locale for foo in * ; do - echo "%lang($foo) %{_datadir}/locale/$foo/*/*" >> \ + echo "%lang($foo) %{_datadir}/locale/$foo/*/*" >> \ $RPM_BUILD_DIR/%{name}-%{version}/trans.list done popd -pushd %{buildroot}/etc/locale +pushd %{buildroot}/etc/locale for foo in * ; do - echo "%lang($foo) %{_datadir}/locale/$foo/*/*" >> \ + echo "%lang($foo) /etc/locale/$foo/*/*" >> \ $RPM_BUILD_DIR/%{name}-%{version}/trans.list done popd - %pre /usr/sbin/groupadd -g 22 -r -f utmp @@ -183,7 +182,7 @@ fi %clean rm -rf $RPM_BUILD_ROOT -%files +%files -f trans.list %defattr(-,root,root) %dir /etc/sysconfig/network-scripts %config(noreplace) %verify(not md5 mtime size) /etc/adjtime diff --git a/po/Makefile b/po/Makefile index 57881b1d..ca28576c 100644 --- a/po/Makefile +++ b/po/Makefile @@ -1,7 +1,7 @@ INSTALL= /usr/bin/install -c INSTALL_PROGRAM= ${INSTALL} INSTALL_DATA= ${INSTALL} -m 644 -INSTALLNLSDIR=/usr/share/locale +INSTALLNLSDIR=/etc/locale MSGMERGE = msgmerge diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 03ec4ce5..4638b709 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # functions This file contains functions to be used by most or all # shell scripts in the /etc/init.d directory. @@ -54,49 +54,6 @@ else INITLOG_ARGS= fi -if [ -z "$GP_LANG" -a -f /etc/sysconfig/i18n ]; then - GP_LANG=$(sed -n 's/"//g ; s/^LANG=//p' /etc/sysconfig/i18n ) -fi - -gprintf() { - if [ -x /usr/bin/gettext ]; then - local TEXT=`LC_MESSAGES=$GP_LANG gettext -e --domain=$TEXTDOMAIN "$1"` - else - local TEXT=$1 - fi - [ "${1#*\\n}" ] || TEXT="$TEXT\n" - shift - printf "$TEXT" "$@" -} - -# Frontend to gprintf (support up to 4 %s in format string) -# returns the message transleted in GPRINTF_MSG and -# the resting parms in GPRINTF_REST -# This simplifies a lot the call of functions like action, -# now with i18n support -gprintf_msg_rest() { -case "$1" in - *%s*%s*%s*%s*) - GPRINTF_MSG=$(gprintf "$1" "$2" "$3" "$4" "$5") - shift 5;; - *%s*%s*%s*) - GPRINTF_MSG=$(gprintf "$1" "$2" "$3" "$4") - shift 4;; - *%s*%s*) - GPRINTF_MSG=$(gprintf "$1" "$2" "$3") - shift 3;; - *%s*) - GPRINTF_MSG=$(gprintf "$1" "$2") - shift 2;; - *) - GPRINTF_MSG=$(gprintf "$1") - shift;; -esac -GPRINTF_REST="$@" -} - - - # Check if $pid (could be plural) are running checkpid() { while [ "$1" ]; do @@ -115,7 +72,7 @@ daemon() { nicelevel=0 while [ "$1" != "${1##-}" -o "$1" != "${1##+}" ]; do case $1 in - '') gprintf "$0: Usage: daemon [+/-nicelevel] {program}\n" $0 + '') echo $"$0: Usage: daemon [+/-nicelevel] {program}" return 1;; --check) shift @@ -169,7 +126,7 @@ killproc() { RC=0 # Test syntax. if [ $# = 0 ]; then - gprintf "Usage: killproc {program} [signal]\n" + echo $"Usage: killproc {program} [signal]" return 1 fi @@ -241,7 +198,7 @@ pidofproc() { # Test syntax. if [ $# = 0 ] ; then - echo "Usage: pidofproc {program}" + echo $"Usage: pidofproc {program}" return 1 fi @@ -267,14 +224,14 @@ status() { # Test syntax. if [ $# = 0 ] ; then - gprintf "Usage: status {program}\n" + echo $"Usage: status {program}" return 1 fi # First try "pidof" pid=`pidof -o $$ -o $PPID -o %PPID -x ${base}` if [ "$pid" != "" ] ; then - gprintf "%s (pid %s) is running...\n" "${base}" "$pid" + echo $"${base} (pid $pid) is running..." return 0 fi @@ -282,16 +239,16 @@ status() { if [ -f /var/run/${base}.pid ] ; then pid=`cat /var/run/${base}.pid | { read foo ; echo $foo ; }` if [ "$pid" != "" ] ; then - gprintf "%s dead but pid file exists\n" "${base}" + echo $"${base} dead but pid file exists" return 1 fi fi # See if /var/lock/subsys/${base} exists if [ -f /var/lock/subsys/${base} ]; then - gprintf "%s dead but subsys locked\n" "${base}" + echo $"${base} dead but subsys locked" return 2 fi - gprintf "%s is stopped\n" "${base}" + echo $"${base} is stopped" return 3 } @@ -299,7 +256,7 @@ echo_success() { [ "$BOOTUP" = "color" ] && $MOVE_TO_COL echo -n "[ " [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS - gprintf "OK" + echo -n $"OK" [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL echo -n " ]" echo -ne "\r" @@ -310,7 +267,7 @@ echo_failure() { [ "$BOOTUP" = "color" ] && $MOVE_TO_COL echo -n "[" [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE - gprintf "FAILED" + echo -n $"FAILED" [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL echo -n "]" echo -ne "\r" @@ -321,7 +278,7 @@ echo_passed() { [ "$BOOTUP" = "color" ] && $MOVE_TO_COL echo -n "[" [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING - gprintf "PASSED" + echo -n $"PASSED" [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL echo -n "]" echo -ne "\r" @@ -330,14 +287,12 @@ echo_passed() { # Log that something succeeded success() { - gprintf_msg_rest "$@" if [ -z "$IN_INITLOG" ]; then - initlog $INITLOG_ARGS -n $0 -s "$GPRINTF_MSG" -e 1 + initlog $INITLOG_ARGS -n $0 -s "$1" -e 1 else # silly hack to avoid EPIPE killing rc.sysinit trap "" SIGPIPE -# FIXME? - echo "$INITLOG_ARGS -n $0 -s \"$1\" -e 1" >&21 + echo $"$INITLOG_ARGS -n $0 -s \"$1\" -e 1" >&21 trap - SIGPIPE fi [ "$BOOTUP" != "verbose" ] && echo_success @@ -347,12 +302,11 @@ success() { # Log that something failed failure() { rc=$? - gprintf_msg_rest "$@" if [ -z "$IN_INITLOG" ]; then - initlog $INITLOG_ARGS -n $0 -s "$GPRINTF_MSG" -e 2 + initlog $INITLOG_ARGS -n $0 -s "$1" -e 2 else trap "" SIGPIPE - echo "-n $0 -s \"$GPRINTF_MSG\" -e 1" >&21 + echo $"$INITLOG_ARGS -n $0 -s \"$1\" -e 2" >&21 trap - SIGPIPE fi [ "$BOOTUP" != "verbose" ] && echo_failure @@ -362,13 +316,11 @@ failure() { # Log that something passed, but may have had errors. Useful for fsck passed() { rc=$? - gprintf_msg_rest "$@" if [ -z "$IN_INITLOG" ]; then - initlog $INITLOG_ARGS -n $0 -s "$GPRINTF_MSG" -e 1 + initlog $INITLOG_ARGS -n $0 -s "$1" -e 1 else trap "" SIGPIPE -#FIXME? - echo "$INITLOG_ARGS -n $0 -s \"$1\" -e 1" >&21 + echo $"$INITLOG_ARGS -n $0 -s \"$1\" -e 1" >&21 trap - SIGPIPE fi [ "$BOOTUP" != "verbose" ] && echo_passed @@ -377,9 +329,10 @@ passed() { # Run some action. Log its output. action() { - gprintf_msg_rest "$@" - echo -n "$GPRINTF_MSG " - initlog $INITLOG_ARGS -c "$GPRINTF_REST" && success "$GPRINTF_MSG" || failure "$GPRINTF_MSG" + STRING=$1 + echo -n $"$STRING " + shift + initlog $INITLOG_ARGS -c "$*" && success $"$STRING" || failure $"$STRING" rc=$? echo return $rc @@ -393,23 +346,20 @@ strstr() { return 0 } - # Confirm whether we really want to run this service confirm() { - gprintf "Start service %s (Y)es/(N)o/(C)ontinue? [Y] " $1 - local YES=`gprintf "yY"` - local NOT=`gprintf "nN"` - local CNT=`gprintf "cC"` - + local YES=$"yY" + local NO=$"nN" + local CONT=$"cC" + + echo -n $"Start service $1 (Y)es/(N)o/(C)ontinue? [Y] " read answer - if strstr "$YES" "$answer" || [ "$answer" = "" ] ; then - return 0 - elif strstr "$CNT" "$answer" ; then - return 2 - elif strstr "$NOT" "$answer" ; then - return 1 + return 0 + elif strstr "$CONT" "$answer" ; then + return 2 + elif strstr "$NO" "$answer" ; then + return 1 fi confirm $* - } diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 095b0e74..c0671ef9 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -14,13 +14,12 @@ PATH=/sbin:/bin:/usr/bin:/usr/sbin . /etc/init.d/functions runcmd() { - gprintf_msg_rest "$@" - echo -n "$GPRINTF_MSG " + echo -n $"$1 " shift if [ "$BOOTUP" = "color" ]; then - $GPRINTF_REST && echo_success || echo_failure + $* && echo_success || echo_failure else - $GPRINTF_REST + $* fi echo } @@ -28,15 +27,15 @@ runcmd() { # See how we were called. case "$0" in *halt) - message=`gprintf "The system is halted"` + message=$"The system is halted" command="halt" ;; *reboot) - message=`gprintf "Please stand by while rebooting the system..."` + message=$"Please stand by while rebooting the system..." command="reboot" ;; *) - gprintf "%s: call me as 'halt' or 'reboot' please!" $0 + echo $"$0: call me as \"rc.halt\" or \"rc.reboot\" please!" exit 1 ;; esac @@ -44,9 +43,9 @@ esac # Kill all processes. [ "${BASH+bash}" = bash ] && enable kill -runcmd "Sending all processes the %s signal..." "TERM" /sbin/killall5 -15 +runcmd "Sending all processes the TERM signal..." /sbin/killall5 -15 sleep 5 -runcmd "Sending all processes the %s signal.." "KILL" /sbin/killall5 -9 +runcmd "Sending all processes the KILL signal..." /sbin/killall5 -9 # Write to wtmp file before unmounting /var halt -w @@ -91,7 +90,7 @@ done [ -f /proc/bus/usb/devices ] && umount /proc/bus/usb # Remount read only anything that's left mounted. -#echo "Remounting remaining filesystems (if any) readonly" +#echo $"Remounting remaining filesystems (if any) readonly" mount | awk '/ext2/ { print $3 }' | while read line; do mount -n -o ro,remount $line done @@ -99,11 +98,11 @@ done runcmd "Unmounting proc file system: " umount /proc # Now halt or reboot. -echo "$message" +echo $"$message" if [ -f /fastboot ]; then - gprintf "On the next boot fsck will be skipped.\n" + echo $"On the next boot fsck will be skipped." elif [ -f /forcefsck ]; then - gprintf "On the next boot fsck will be forced.\n" + echo $"On the next boot fsck will be forced." fi HALTARGS="-i -d" diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 3d18afd6..8b51408c 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -35,10 +35,10 @@ case "$1" in [ -n "$NFSFSTAB" ] && { [ ! -f /var/lock/subsys/portmap ] && service portmap start - action "Mounting %s filesystems: " NFS mount -a -t nfs + action "Mounting NFS filesystems: " mount -a -t nfs } - [ -n "$SMBFSTAB" ] && action "Mounting %s filesystems: " SMB mount -a -t smbfs - [ -n "$NCPFSTAB" ] && action "Mounting %s filesystems: " NCP mount -a -t ncpfs + [ -n "$SMBFSTAB" ] && action "Mounting SMB filesystems: " mount -a -t smbfs + [ -n "$NCPFSTAB" ] && action "Mounting NCP filesystems: " mount -a -t ncpfs touch /var/lock/subsys/netfs action "Mounting other filesystems: " mount -a -t nonfs,smbfs,ncpfs ;; @@ -50,9 +50,9 @@ case "$1" in while [ -n "$remaining" -a "$retry" -gt 0 ] do if [ "$retry" -lt 3 ]; then - action "Unmounting %s filesystems (retry): " NFS umount -f -a -t nfs + action "Unmounting NFS filesystems (retry): " umount -f -a -t nfs else - action "Unmounting %s filesystems: " NFS umount -f -a -t nfs + action "Unmounting NFS filesystems: " umount -f -a -t nfs fi sleep 2 remaining=`awk '!/^#/ && $3 ~ /^nfs/ && $2 != "/" {print $2}' /proc/mounts` @@ -63,38 +63,38 @@ case "$1" in sig=-9 done } - [ -n "$SMBMTAB" ] && action "Unmounting %s filesystems: " SMB umount -a -t smbfs - [ -n "$NCPMTAB" ] && action "Unmounting %s filesystems: " NCP umount -a -t ncpfs + [ -n "$SMBMTAB" ] && action "Unmounting SMB filesystems: " umount -a -t smbfs + [ -n "$NCPMTAB" ] && action "Unmounting NCP filesystems: " umount -a -t ncpfs rm -f /var/lock/subsys/netfs ;; status) if [ -f /proc/mounts ] ; then [ -n "$NFSFSTAB" ] && { - gprintf "Configured %s mountpoints:\n" NFS + echo $"Configured NFS mountpoints: " for fs in $NFSFSTAB; do echo $fs ; done } [ -n "$SMBFSTAB" ] && { - gprintf "Configured %s mountpoints:\n" SMB + echo $"Configured SMB mountpoints: " for fs in $SMBFSTAB; do echo $fs ; done } [ -n "$NCPFSTAB" ] && { - gprintf "Configured %s mountpoints:\n" NCP + echo $"Configured NCP mountpoints: " for fs in $NCPFSTAB; do echo $fs ; done } [ -n "$NFSMTAB" ] && { - gprintf "Active %s mountpoints:\n" NFS + echo $"Active NFS mountpoints: " for fs in $NFSMTAB; do echo $fs ; done } [ -n "$SMBMTAB" ] && { - gprintf "Active %s mountpoints:\n" SMB + echo $"Active SMB mountpoints: " for fs in $SMBMTAB; do echo $fs ; done } [ -n "$NCPMTAB" ] && { - gprintf "Active %s mountpoints:\n" NCP + echo $"Active NCP mountpoints: " for fs in $NCPMTAB; do echo $fs ; done } else - gprintf "/proc filesystem unavailable\n" + echo $"/proc filesystem unavailable" fi ;; restart) @@ -105,7 +105,7 @@ case "$1" in $0 start ;; *) - gprintf "Usage: %s {start|stop|restart|reload|status}\n" netfs + echo $"Usage: netfs {start|stop|restart|reload|status}" exit 1 esac diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 30e72b27..61ad8fb9 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # network Bring up/down networking # @@ -46,7 +46,7 @@ case "$1" in action "Setting network parameters: " sysctl -p /etc/sysctl.conf - action "Bringing up interface %s: " lo ./ifup ifcfg-lo + action "Bringing up interface lo: " ./ifup ifcfg-lo case "$IPX" in yes|true) @@ -114,7 +114,7 @@ case "$1" in for i in $interfaces ; do if LC_ALL= LANG= ifconfig $i 2>/dev/null | grep -q " UP " >/dev/null 2>&1 ; then - action "Shutting down interface %s: " $i ./ifdown $i boot + action "Shutting down interface $i: " ./ifdown $i boot fi done case "$IPX" in @@ -141,18 +141,18 @@ case "$1" in rm -f /var/lock/subsys/network ;; status) - gprintf "Configured devices:\n" + echo $"Configured devices:" echo lo $interfaces if [ -x /sbin/linuxconf ] ; then eval `/sbin/linuxconf --hint netdev` - gprintf "Devices that are down:\n" + echo $"Devices that are down:" echo $DEV_UP - gprintf "Devices with modified configuration:\n" + echo $"Devices with modified configuration:" echo $DEV_RECONF else - gprintf "Currently active devices:\n" - echo `LC_ALL= LANG= /sbin/ifconfig | grep ^[a-z] | awk '{print $1}'` + echo $"Currently active devices:" + echo `/sbin/ifconfig | grep ^[a-z] | awk '{print $1}'` fi ;; restart) @@ -217,7 +217,7 @@ case "$1" in fi ;; *) - gprintf "Usage: %s {start|stop|restart|reload|status|probe}\n" "network" + echo $"Usage: network {start|stop|restart|reload|status|probe}" exit 1 esac diff --git a/rc.d/init.d/random b/rc.d/init.d/random index 2eb95f66..363ffdf2 100755 --- a/rc.d/init.d/random +++ b/rc.d/init.d/random @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # random Script to snapshot random state and reload it at boot time. # @@ -41,9 +41,9 @@ case "$1" in status) # this is way overkill, but at least we have some status output... if [ -c /dev/random ] ; then - gprintf "The random data source exists\n" + echo $"The random data source exists" else - gprintf "The random data source is missing\n" + echo $"The random data source is missing" fi ;; restart|reload) @@ -53,7 +53,7 @@ case "$1" in *) # do not advertise unreasonable commands that there is no reason # to use with this device - gprintf "Usage: %s {start|stop|status|restart|reload}\n" "random" + echo $"Usage: random {start|stop|status|restart|reload}" exit 1 esac diff --git a/rc.d/init.d/rawdevices b/rc.d/init.d/rawdevices index cb4152a2..8984fa9f 100755 --- a/rc.d/init.d/rawdevices +++ b/rc.d/init.d/rawdevices @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # rawdevices This shell script assignes rawdevices to block devices # @@ -28,17 +28,17 @@ function assign_raw() cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read RAW BLOCK; do if [ -n "$RAW" -a -n "$BLOCK" ]; then if [ "`dirname $RAW`" = "/dev" -a -d /dev/raw ]; then - gprintf " Please correct your /etc/sysconfig/rawdevices:\n" - gprintf " rawdevices are now located in the directory /dev/raw/\n" - gprintf " If the command 'raw' still refers to /dev/raw as a file.\n" - gprintf " you'll have to upgrade your util-linux package\n" + echo $" Please correct your /etc/sysconfig/rawdevices:" + echo $" rawdevices are now located in the directory /dev/raw/ " + echo $" If the command 'raw' still refers to /dev/raw as a file." + echo $" you'll have to upgrade your util-linux package" exit 0 fi if [ "`dirname $RAW`" = "/dev/raw" -a -f /dev/raw ]; then - gprintf " Please correct your /etc/sysconfig/rawdevices:\n" - gprintf " rawdevices are now located in the directory /dev/raw/\n" - gprintf " If the command 'raw' still refers to /dev/raw as a file.\n" - gprintf " you'll have to upgrade your util-linux package\n" + echo $" Please correct your /etc/sysconfig/rawdevices:" + echo $" rawdevices are now located in the directory /dev/raw/ " + echo $" If the command 'raw' still refers to /dev/raw as a file." + echo $" you'll have to upgrade your util-linux package" exit 0 fi @@ -52,9 +52,9 @@ function assign_raw() case "$1" in start) # Assign devices - gprintf "Assigning devices: " + echo $"Assigning devices: " assign_raw - echo "done" + echo $"done" ;; stop) # No action to be taken here @@ -65,7 +65,7 @@ case "$1" in if [ $ID -eq 0 ]; then raw -qa else - gprintf "You need to be root to use this command!\n" + echo $"You need to be root to use this command ! " fi ;; @@ -74,7 +74,7 @@ case "$1" in ;; *) - gprintf "Usage: rawdevice {start|stop|status|restart}\n" + echo $"Usage: rawdevice {start|stop|status|restart}" exit 1 esac diff --git a/rc.d/init.d/single b/rc.d/init.d/single index 92de156e..84341a50 100755 --- a/rc.d/init.d/single +++ b/rc.d/init.d/single @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # # rc.single This file is executed by init when it goes into runlevel @@ -23,10 +23,10 @@ fi # Kill all processes. [ "${BASH+bash}" = bash ] && enable kill -gprintf "Sending all processes the %s signal...\n" "TERM" +echo $"Sending all processes the TERM signal..." kill -15 -1 sleep 5 -gprintf "Sending all processes the %s signal..\n" "KILL" +echo $"Sending all processes the KILL signal.." kill -9 -1 rm -f /var/lock/subsys/* @@ -53,5 +53,5 @@ for i in /etc/rc1.d/S[0-9][0-9]*; do done # Now go to the single user level. -gprintf "Telling INIT to go to single user mode.\n" +echo $"Telling INIT to go to single user mode." exec init -t1 S @@ -24,10 +24,10 @@ if [ "$previous" = "N" ]; then if grep -i confirm /proc/cmdline >/dev/null || [ -f /var/run/confirm ] ; then rm -f /var/run/confirm CONFIRM=yes - gprintf "Entering interactive startup\n" + echo $"Entering interactive startup" else CONFIRM= - gprintf "Entering non-interactive startup\n" + echo $"Entering non-interactive startup" fi fi @@ -37,7 +37,7 @@ export CONFIRM [ -n "$argv1" ] && runlevel="$argv1" # Tell linuxconf what runlevel we are in -[ -d /var/run ] && echo "/etc/rc$runlevel.d" > /var/run/runlevel.dir +[ -d /var/run ] && echo $"/etc/rc$runlevel.d" > /var/run/runlevel.dir # Is there an rc directory for this new runlevel? if [ -d /etc/rc$runlevel.d ]; then @@ -60,7 +60,7 @@ if [ -d /etc/rc$runlevel.d ]; then if egrep -q "(killproc |action )" $i ; then $i stop else - action "Stopping %s: " $subsys $i stop + action "Stopping $subsys: " $i stop fi done @@ -103,7 +103,7 @@ if [ -d /etc/rc$runlevel.d ]; then if [ "$subsys" = "halt" -o "$subsys" = "reboot" -o "$subsys" = "single" -o "$subsys" = "local" ]; then $i start else - action "Starting %s: " $subsys $i start + action "Starting $subsys: " $i start fi fi done diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index ec0bdc5c..147a4277 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # /etc/rc.sysinit - run once at boot time # @@ -34,13 +34,14 @@ fi . /etc/init.d/functions # Print a banner. ;) -gprintf "\t\t\tWelcome to " -[ "$BOOTUP" != "serial" ] && echo -en "\\033[1;31m" -echo -en "Red Hat" -[ "$BOOTUP" != "serial" ] && echo -en "\\033[0;39m" -echo " Linux" +echo -en $"\t\t\tWelcome to " +[ "$BOOTUP" != "serial" ] && echo -en $"\\033[1;31m" +echo -en $"Red Hat" +[ "$BOOTUP" != "serial" ] && echo -en $"\\033[0;39m" +echo $" Linux" if [ "$PROMPT" != "no" ]; then - gprintf "\t\tPress 'I' to enter interactive startup.\n" + echo -en $"\t\tPress 'I' to enter interactive startup." + echo sleep 1 fi @@ -100,7 +101,7 @@ esac /sbin/hwclock $CLOCKFLAGS -action "Setting clock %s: %s" "$CLOCKDEF" "`date`" date +action "Setting clock $CLOCKDEF: `date`" date if [ "`/sbin/consoletype`" == "vt" ]; then # Load keymap @@ -120,9 +121,9 @@ if [ "`/sbin/consoletype`" == "vt" ]; then if [ -n "$KEYMAP" ]; then # Since this takes in/output from stdin/out, we can't use initlog if [ -n "$KEYTABLE" ]; then - gprintf "Loading default keymap (%s): " "$KEYTABLE" + echo -n $"Loading default keymap ($KEYTABLE): " else - gprintf "Loading default keymap: " + echo -n $"Loading default keymap: " fi loadkeys $KEYMAP < /dev/tty0 > /dev/tty0 2>/dev/null && \ success "Loading default keymap" || failure "Loading default keymap" @@ -137,7 +138,7 @@ if [ "`/sbin/consoletype`" == "vt" ]; then -f /usr/lib/kbd/consolefonts/$SYSFONT.psf.gz -o \ -f /etc/sysconfig/console/$SYSFONT.gz -o \ -f /usr/lib/kbd/consolefonts/$SYSFONT.gz ]; then - action "Setting default font (%s): " "$SYSFONT" /sbin/setsysfont + action "Setting default font ($SYSFONT): " /sbin/setsysfont fi fi fi @@ -146,7 +147,7 @@ fi action "Activating swap partitions: " swapon -a # Set the hostname. -action "Setting hostname %s: " "${HOSTNAME}" hostname ${HOSTNAME} +action "Setting hostname ${HOSTNAME}: " hostname ${HOSTNAME} # Initialize USB controller and HID devices usb=0 @@ -204,7 +205,7 @@ _RUN_QUOTACHECK=0 ROOTFSTYPE=`grep " / " /proc/mounts | awk '{ print $3 }'` if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ]; then - STRING=`gprintf "Checking root filesystem"` + STRING=$"Checking root filesystem" echo $STRING initlog -c "fsck -T -a $fsckoptions /" rc=$? @@ -222,17 +223,17 @@ if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ]; then failure "$STRING" echo echo - gprintf "*** An error occurred during the file system check.\n" - gprintf "*** Dropping you to a shell; the system will reboot\n" - gprintf "*** when you leave the shell.\n" + echo $"*** An error occurred during the file system check." + echo $"*** Dropping you to a shell; the system will reboot" + echo $"*** when you leave the shell." - PS1=`gprintf "(Repair filesystem) # "`; export PS1 + PS1=$"(Repair filesystem) \# # "; export PS1 sulogin - gprintf "Unmounting file systems\n" + echo $"Unmounting file systems" umount -a mount -n -o remount,ro / - gprintf "Automatic reboot in progress.\n" + echo $"Automatic reboot in progress." reboot -f elif [ "$rc" = "1" ]; then _RUN_QUOTACHECK=1 @@ -392,7 +393,7 @@ fi # Add raid devices if [ -f /proc/mdstat -a -f /etc/raidtab ]; then - gprintf "Starting up RAID devices: " + echo -n $"Starting up RAID devices: " rc=0 @@ -432,17 +433,17 @@ if [ -f /proc/mdstat -a -f /etc/raidtab ]; then if [ $rc -gt 0 ]; then echo echo - gprintf "*** An error occurred during the RAID startup\n" - gprintf "*** Dropping you to a shell; the system will reboot\n" - gprintf "*** when you leave the shell.\n" + echo $"*** An error occurred during the RAID startup" + echo $"*** Dropping you to a shell; the system will reboot" + echo $"*** when you leave the shell." - PS1=`gprintf "(RAID Repair) # "`; export PS1 + PS1=$"(RAID Repair) \# # "; export PS1 sulogin - gprintf "Unmounting file systems\n" + echo $"Unmounting file systems" umount -a mount -n -o remount,ro / - gprintf "Automatic reboot in progress.\n" + echo $"Automatic reboot in progress." reboot -f fi fi @@ -450,8 +451,8 @@ fi _RUN_QUOTACHECK=0 # Check filesystems if [ -z "$fastboot" ]; then - STRING=`gprintf "Checking filesystems"` - printf "$STRING\n" + STRING=$"Checking filesystems" + echo $STRING initlog -c "fsck -T -R -A -a $fsckoptions" rc=$? if [ "$rc" = "0" ]; then @@ -467,17 +468,17 @@ if [ -z "$fastboot" ]; then failure "$STRING" echo echo - gprintf "*** An error occurred during the file system check.\n" - gprintf "*** Dropping you to a shell; the system will reboot\n" - gprintf "*** when you leave the shell.\n" + echo $"*** An error occurred during the file system check." + echo $"*** Dropping you to a shell; the system will reboot" + echo $"*** when you leave the shell." - PS1=`gprintf "(Repair filesystem) # "`; export PS1 + PS1=$"(Repair filesystem) \# # "; export PS1 sulogin - gprintf "Unmounting file systems" + echo $"Unmounting file systems" umount -a mount -n -o remount,ro / - gprintf "Automatic reboot in progress.\n" + echo $"Automatic reboot in progress." reboot -f elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then _RUN_QUOTACHECK=1 @@ -7,7 +7,7 @@ SERVICE= SERVICEDIR="/etc/init.d" if [ $# -eq 0 ]; then - echo "${USAGE}" >&2 + echo $"${USAGE}" >&2 exit 1 fi @@ -15,11 +15,11 @@ while [ $# -gt 0 ] do case "${1}" in --help | -h | --h* ) - echo "${USAGE}" >&2 + echo $"${USAGE}" >&2 exit 0 ;; --version | -V ) - echo "${VERSION}" >&2 + echo $"${VERSION}" >&2 exit 0 ;; *) @@ -59,6 +59,6 @@ done if [ -x "${SERVICEDIR}/${SERVICE}" ]; then "${SERVICEDIR}/${SERVICE}" ${OPTIONS} else - echo "${SERVICE}: unrecognized service" >&2 + echo $"${SERVICE}: unrecognized service" >&2 exit 1 fi @@ -26,7 +26,7 @@ elif [ -x /usr/bin/setfont ]; then # /usr/bin/setfont fi else - echo "can't set font" + echo $"can't set font" exit 1 fi exit 0 diff --git a/src/testdinit b/src/testdinit index 67ea8c37..a6500991 100755 --- a/src/testdinit +++ b/src/testdinit @@ -11,14 +11,14 @@ case "$1" in start) # Start daemons. - echo -n "Starting testd: " + echo -n $"Starting testd: " testd & echo touch /var/lock/subsys/testd ;; stop) # Stop daemons. - echo -n "Shutting down testd: " + echo -n $"Shutting down testd: " killproc testd echo rm -f /var/lock/subsys/testd @@ -29,15 +29,15 @@ case "$1" in exit $? ;; restart) - echo -n "Shutting down testd: " + echo -n $"Shutting down testd: " killproc testd echo - echo -n "Starting testd: " + echo -n $"Starting testd: " testd & echo ;; *) - echo "Usage: testd {start|stop|status|restart}" + echo $"Usage: testd {start|stop|status|restart}" exit 1 esac diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index 53a28f8b..3a7074ba 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash PATH=/sbin:/usr/sbin:/bin:/usr/bin TEXTDOMAIN=initscripts @@ -9,13 +9,13 @@ cd /etc/sysconfig/network-scripts CONFIG=$1 [ -z "$CONFIG" ] && { - gprintf "usage: %s <device name>\n" ifdown >&2 + echo $"usage: ifdown <device name>" >&2 exit 1 } [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG [ -f "$CONFIG" ] || { - gprintf "usage: %s <device name>\n" ifdown >&2 + echo $"usage: ifdown <device name>\n" >&2 exit 1 } @@ -25,7 +25,7 @@ if [ $UID != 0 ]; then exec /usr/sbin/usernetctl $CONFIG down fi fi - gprintf "Users cannot control this device.\n" >&2 + echo $"Users cannot control this device." >&2 exit 1 fi diff --git a/sysconfig/network-scripts/ifdown-aliases b/sysconfig/network-scripts/ifdown-aliases index bc62dbf0..9b4c2f2c 100755 --- a/sysconfig/network-scripts/ifdown-aliases +++ b/sysconfig/network-scripts/ifdown-aliases @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash # removes aliases of device $1 device=$1 if [ "$device" = "" ]; then - echo "usage: $0 <net-device>" + echo $"usage: $0 <net-device>" exit 1 fi diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index df2ecef1..0e5ee116 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -11,13 +11,13 @@ need_hostname CONFIG=${1} [ -z "${CONFIG}" ] && { - gprintf "usage: ifup <device name>\n" >&2 + echo $"usage: ifup <device name>" >&2 exit 1 } [ -f "${CONFIG}" ] || CONFIG=ifcfg-${CONFIG} [ -f "${CONFIG}" ] || { - gprintf "usage: ifup <device name>\n" >&2 + echo $"usage: ifup <device name>" >&2 exit 1 } @@ -27,7 +27,7 @@ if [ ${UID} != 0 ]; then exec /usr/sbin/usernetctl ${CONFIG} up fi fi - gprintf "Users cannot control this device.\n" >&2 + echo $"Users cannot control this device." >&2 exit 1 fi @@ -74,7 +74,7 @@ fi # is this device available? (this catches PCMCIA devices for us) LC_ALL= LANG= /sbin/ifconfig ${REALDEVICE} 2>&1 | grep -s "not found" > /dev/null if [ "$?" = "0" ]; then - gprintf "Delaying %s initialization.\n" "${DEVICE}" + echo $"Delaying ${DEVICE} initialization." exit 1 fi @@ -83,7 +83,7 @@ if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" -a \ RFLAG="" ; [ "${RECEIVEONLY}" = yes ] && RFLAG="-r" ifconfig ${DEVICE} down - gprintf "Enslaving %s to %s" "${DEVICE}" "${MASTER}" + echo $"Enslaving ${DEVICE} to ${MASTER}" ifenslave ${RFLAG} "${MASTER}" "${DEVICE}" exit 0 @@ -108,14 +108,14 @@ if [ -n "${DYNCONFIG}" ]; then PUMPARGS="${PUMPARGS} -d" DHCPDARGS="${DHCPDARGS} -R" fi - gprintf "Determining IP information for %s..." "${DEVICE}" + echo -n $"Determining IP information for ${DEVICE}..." if [ -x /sbin/pump ] && /sbin/pump ${PUMPARGS} -i ${DEVICE} ; then - gprintf " done.\n" + echo $" done." elif [ -x /sbin/dhcpcd ] && /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then - gprintf " done.\n" + echo $" done." else - gprintf " failed.\n" + echo $" failed." exit 1 fi else diff --git a/sysconfig/network-scripts/ifup-aliases b/sysconfig/network-scripts/ifup-aliases index 23a9af96..8f0e798f 100755 --- a/sysconfig/network-scripts/ifup-aliases +++ b/sysconfig/network-scripts/ifup-aliases @@ -62,7 +62,7 @@ TEXTDOMAIN=initscripts device=$1 if [ "$device" = "" ]; then - gprintf "usage: %s <net-device>\n" "$0" + echo $"usage: ifup-aliases <net-device>\n" exit 1 fi @@ -104,7 +104,7 @@ eval ` ( # read defaults from the parent config file PARENTCONFIG=ifcfg-$device [ -f $PARENTCONFIG ] || { - echo "Missing config file $PARENTCONFIG." >&2 + echo $"Missing config file $PARENTCONFIG." >&2 exit 1 } eval ` ( @@ -145,15 +145,15 @@ function new_interface () "; if [ -n "$ipseen" ]; then - echo "error in $FILE: already seen ipaddr $IPADDR in $ipseen" >&2;exit 0 + echo $"error in $FILE: already seen ipaddr $IPADDR in $ipseen" >&2;exit 0 fi if [ -n "$devseen" ]; then - echo "error in $FILE: already seen device $parent_device:$DEVNUM\ in $devseen" >&2; exit 0 + echo $"error in $FILE: already seen device $parent_device:$DEVNUM\ in $devseen" >&2; exit 0 fi if [ -z "$DEVICE" -o -z "$IPADDR" ]; then - echo "error in $FILE: didn't specify device or ipaddr" >&2 ; exit 0 + echo $"error in $FILE: didn't specify device or ipaddr" >&2 ; exit 0 fi if [ -z "$NETMASK" ]; then @@ -219,7 +219,7 @@ function new_interface () setup_this=yes fi if [ -n "$rdev_mark" -a "$rdev_mark" != "$newmark" ]; then - echo "error in ifcfg-${parent_device}:\* files" >&2 ; exit 0 + echo $"error in ifcfg-${parent_device}:\* files" >&2 ; exit 0 fi eval " rdev_${DEVNUM}_mark=\$newmark "; else @@ -229,7 +229,7 @@ function new_interface () if [ -n "$rdevip" -a "$rdevip" != "${DEVNUM}" ]; then eval " mark_remove=\$rdev_${rdevip}_mark "; if [ -n "$mark_remove" -a "$mark_remove" != "remove" ]; then - echo "error in ifcfg-${parent_device}:\* files" >&2 ; exit 0 + echo $"error in ifcfg-${parent_device}:\* files" >&2 ; exit 0 fi if [ "$mark_remove" != "remove" ]; then eval " rdev_${rdevip}_mark=remove "; @@ -334,11 +334,11 @@ for FILE in ifcfg-${parent_device}-range* ; do ipaddr_endnum=${IPADDR_END##*.} if [ "${IPADDR_START%.*}" != "${IPADDR_END%.*}" ]; then - echo "error in $FILE: IPADDR_START and IPADDR_END don't argree" >&2; exit 0 + echo $"error in $FILE: IPADDR_START and IPADDR_END don't argree" >&2; exit 0 fi if [ $ipaddr_startnum -gt $ipaddr_endnum ]; then - echo "error in $FILE: IPADDR_START greater than IPADDR_END" >&2; exit 0 + echo $"error in $FILE: IPADDR_START greater than IPADDR_END" >&2; exit 0 fi ipaddr_num=$ipaddr_startnum diff --git a/sysconfig/network-scripts/ifup-ipx b/sysconfig/network-scripts/ifup-ipx index 926ac910..53871cca 100755 --- a/sysconfig/network-scripts/ifup-ipx +++ b/sysconfig/network-scripts/ifup-ipx @@ -4,7 +4,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin if [ "$1" = "" ]; then - echo "usage: $0 <net-device>" + echo $"usage: $0 <net-device>" exit 1 fi diff --git a/sysconfig/network-scripts/ifup-ppp b/sysconfig/network-scripts/ifup-ppp index 0bdcc591..2931940a 100755 --- a/sysconfig/network-scripts/ifup-ppp +++ b/sysconfig/network-scripts/ifup-ppp @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash PATH=/sbin:/usr/sbin:/bin:/usr/bin cd /etc/sysconfig/network-scripts @@ -44,18 +44,18 @@ if [ "${2}" = "boot" -a "${ONBOOT}" = "no" ]; then fi [ -x /usr/sbin/pppd ] || { - gprintf "/usr/sbin/pppd does not exist or is not executable\n" - gprintf "ifup-ppp for %s exiting\n" "${DEVICE}" + echo $"/usr/sbin/pppd does not exist or is not executable" + echo $"ifup-ppp for ${DEVICE} exiting" logger -p daemon.info -t ifup-ppp \ - `gprintf "/usr/sbin/pppd does not exist or is not executable for %s\n" "${DEVICE}"` + $"/usr/sbin/pppd does not exist or is not executable for ${DEVICE}" exit 1 } [ -n "${WVDIALSECT}" -o -f /etc/sysconfig/network-scripts/chat-${DEVICE} ] || { - echo "/etc/sysconfig/network-scripts/chat-${DEVICE} does not exist" - echo "ifup-ppp for ${DEVICE} exiting" + echo $"/etc/sysconfig/network-scripts/chat-${DEVICE} does not exist" + echo $"ifup-ppp for ${DEVICE} exiting" logger -p daemon.info -t ifup-ppp \ - `gprintf "/etc/sysconfig/network-scripts/chat-%s does not exist for %s" "${DEVICE}" "${DEVICE}"` + $"/etc/sysconfig/network-scripts/chat-${DEVICE} does not exist for ${DEVICE}" exit 1 } @@ -109,7 +109,7 @@ else fi (logger -p daemon.info -t ifup-ppp \ - "pppd started for ${DEVICE} on ${MODEMPORT} at ${LINESPEED}" &)& + $"pppd started for ${DEVICE} on ${MODEMPORT} at ${LINESPEED}" &)& if [ -n "${WVDIALSECT}" ] ; then exec /usr/sbin/pppd $opts ${MODEMPORT} ${LINESPEED} \ diff --git a/sysconfig/network-scripts/ifup-routes b/sysconfig/network-scripts/ifup-routes index b4e4a98a..580b4d6e 100755 --- a/sysconfig/network-scripts/ifup-routes +++ b/sysconfig/network-scripts/ifup-routes @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash TEXTDOMAIN=initscripts # adds static routes which go through device $1 @@ -6,7 +6,7 @@ TEXTDOMAIN=initscripts . /etc/rc.d/init.d/functions if [ "$1" = "" ]; then - gprintf "usage: %s <net-device>\n" "$0" + echo $"usage: ifup-routes <net-device>" exit 1 fi diff --git a/sysconfig/network-scripts/ifup-sl b/sysconfig/network-scripts/ifup-sl index 2b53b93e..27be5fe3 100755 --- a/sysconfig/network-scripts/ifup-sl +++ b/sysconfig/network-scripts/ifup-sl @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash TEXTDOMAIN=initscripts PATH=/sbin:/usr/sbin:/bin:/usr/bin . /etc/rc.d/init.d/functions @@ -30,10 +30,10 @@ if [ -z "$RETRYTIMEOUT" ]; then fi [ -x /usr/sbin/dip ] || { - gprintf "%s does not exist or is not executable\n" "/usr/sbin/dip" - gprintf "%s for %s exiting\n" "ifup-sl" "$DEVICE" + echo $"/usr/sbin/dip does not exist or is not executable" + echo $"ifup-sl for $DEVICE exiting" logger -p daemon.info -t ifup-sl \ - "/usr/sbin/dip does not exist or is not executable for $DEVICE" + $"/usr/sbin/dip does not exist or is not executable for $DEVICE" exit 1 } @@ -42,17 +42,17 @@ DIPSCRIPT=/etc/sysconfig/network-scripts/dip-$DEVNAME DIPSCRIPT=/etc/sysconfig/network-scripts/dip-$PARENTDEVNAME } [ -f $DIPSCRIPT ] || { - gprintf "%s does not exist\n" "/etc/sysconfig/network-scripts/dip-$DEVICE" - gprintf "%s for %s exiting\n" "ifup-sl" "$DEVICE" + echo $"/etc/sysconfig/network-scripts/dip-$DEVICE does not exist" + echo $"ifup-sl for $DEVICE exiting" logger -p daemon.info -t ifup-sl \ - "/etc/sysconfig/network-scripts/dip-$DEVICE does not exist for $DEVICE" + $"/etc/sysconfig/network-scripts/dip-$DEVICE does not exist for $DEVICE" exit 1 } while : ; do echo > /var/run/sl-$DEVICE.dev (logger -p daemon.info -t ifup-sl \ - "dip started for $DEVICE on $MODEMPORT at $LINESPEED" &)& + $"dip started for $DEVICE on $MODEMPORT at $LINESPEED" &)& doexec /usr/sbin/dip dip-$DEVICE $DIPSCRIPT if [ "$PERSIST" != "yes" -o ! -f /var/run/sl-$DEVICE.dev ] ; then exit 0 |