aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian La Roche <laroche@redhat.com>2002-07-10 11:16:23 +0000
committerFlorian La Roche <laroche@redhat.com>2002-07-10 11:16:23 +0000
commit79d81b12ba74f837ba95aa56c8d0e46030426ee7 (patch)
tree010109d4e1edd4fdab19a422c04297f8d48de902
parentd5f7fbcf3f34a7fdf352584b53691c6f592808a5 (diff)
downloadinitscripts-79d81b12ba74f837ba95aa56c8d0e46030426ee7.tar
initscripts-79d81b12ba74f837ba95aa56c8d0e46030426ee7.tar.gz
initscripts-79d81b12ba74f837ba95aa56c8d0e46030426ee7.tar.bz2
initscripts-79d81b12ba74f837ba95aa56c8d0e46030426ee7.tar.xz
initscripts-79d81b12ba74f837ba95aa56c8d0e46030426ee7.zip
- code cleanups in rc.sysinit
-rw-r--r--initscripts.spec1
-rwxr-xr-xrc.d/rc.sysinit21
2 files changed, 11 insertions, 11 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 0f5c5b38..f844166c 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -252,6 +252,7 @@ rm -rf $RPM_BUILD_ROOT
- better checks for backup files
- drastically reduce the number of consoletype invocations
- do not export "GATEWAY" in network-functions
+- code cleanups in rc.sysinit
* Fri Jul 05 2002 Florian La Roche <Florian.LaRoche@redhat.de>
- rc.sysinit: do not load raid modules unless /etc/raidtab exists
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 3f5b8f0d..115e61e9 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -179,7 +179,7 @@ fi
needusbstorage=
if [ $usb = "1" ]; then
- needusbstorage=`cat /proc/bus/usb/devices 2>/dev/null|grep -e "^I.*Cls=08"`
+ needusbstorage=`grep -e "^I.*Cls=08" /proc/bus/usb/devices 2>/dev/null`
action $"Initializing USB HID interface: " modprobe hid 2> /dev/null
action $"Initializing USB keyboard: " modprobe keybdev
action $"Initializing USB mouse: " modprobe mousedev
@@ -233,7 +233,7 @@ fi
_RUN_QUOTACHECK=0
-ROOTFSTYPE=`grep " / " /proc/mounts | awk '{ print $3 }'`
+ROOTFSTYPE=`awk '/ \/ / { print $3 }' /proc/mounts`
if [ -z "$fastboot" -a "X$ROOTFSTYPE" != "Xnfs" ]; then
STRING=$"Checking root filesystem"
@@ -516,7 +516,7 @@ action $"Mounting local filesystems: " mount -a -t nonfs,smbfs,ncpfs -O no_netde
if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then
if [ -x /sbin/convertquota ]; then
# try to convert old quotas
- for mountpt in `cat /etc/mtab | awk '$4 ~ /quota/{print $2}'`; do
+ for mountpt in `awk '$4 ~ /quota/{print $2}' /etc/mtab` ; do
if [ -f "$mountpt/quota.user" ]; then
action $"Converting old user quota files: " \
/sbin/convertquota -u $mountpt && \
@@ -575,14 +575,13 @@ rm -f /fastboot /fsckoptions /forcefsck /.autofsck /halt /poweroff
_NEED_XFILES=
[ -f /var/run/utmpx -o -f /var/log/wtmpx ] && _NEED_XFILES=1
-# Clean up /var
-# I'd use find, but /usr may not be mounted.
-for afile in /var/lock/* /var/run/*; do
- if [ -d "$afile" ]; then
- [ "`basename $afile`" != "news" -a "`basename $afile`" != "sudo" -a "`basename $afile`" != "mon" ] && rm -f $afile/*
- else
- rm -f $afile
- fi
+# Clean up /var. I'd use find, but /usr may not be mounted.
+for afile in /var/lock/* /var/run/* ; do
+ [ -d "$afile" ] || continue
+ case "`basename $afile`" in
+ news|sudo|mon) ;;
+ *) rm -f $afile/* ;;
+ esac
done
rm -f /var/lib/rpm/__db*