aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-01-23 19:59:11 +0000
committerBill Nottingham <notting@redhat.com>2001-01-23 19:59:11 +0000
commita4a25465cd2844d72bf518188b813c009450f505 (patch)
tree25ca5df7db282aa4202813aba3c0e18083927c25 /rc.d
parentbee84f538da8b1d5885975c119bfd7fd5ae7e9a3 (diff)
downloadinitscripts-a4a25465cd2844d72bf518188b813c009450f505.tar
initscripts-a4a25465cd2844d72bf518188b813c009450f505.tar.gz
initscripts-a4a25465cd2844d72bf518188b813c009450f505.tar.bz2
initscripts-a4a25465cd2844d72bf518188b813c009450f505.tar.xz
initscripts-a4a25465cd2844d72bf518188b813c009450f505.zip
change i18n stuff around; don't call gettext explicitly, just do echo $"some string"
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/init.d/functions114
-rwxr-xr-xrc.d/init.d/halt25
-rwxr-xr-xrc.d/init.d/netfs30
-rwxr-xr-xrc.d/init.d/network18
-rwxr-xr-xrc.d/init.d/random8
-rwxr-xr-xrc.d/init.d/rawdevices26
-rwxr-xr-xrc.d/init.d/single8
-rwxr-xr-xrc.d/rc10
-rwxr-xr-xrc.d/rc.sysinit69
9 files changed, 129 insertions, 179 deletions
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
diff --git a/rc.d/rc b/rc.d/rc
index 3609fe9f..3194f474 100755
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -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