aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2000-12-17 08:24:49 +0000
committerDoug Barton <dougb@FreeBSD.org>2000-12-17 08:24:49 +0000
commitfcc66fcfa9017efda03f01df5a7ab001deb41d56 (patch)
treebf9a894f87cac5d67f8d4ad410643ff1b449cab5 /etc
parente14563a3f35eb1e38192a44cf6dc60654037ecc5 (diff)
downloadsrc-fcc66fcfa9017efda03f01df5a7ab001deb41d56.tar.gz
src-fcc66fcfa9017efda03f01df5a7ab001deb41d56.zip
In addition to:
Apply a more consistent style to the echo statements in /etc/ scripts. * Put quotes around each line * Single quotes for lines with no variable interpolation * Double quotes if there is * Capitalize each word that begins a line * Make echo -n 'Doing foo:' ... echo '.' more of a standard Also: * Use rm -f on /var/run/dev.db so if it's not there (devfs) it doesn't error * Shorten the ldconfig messages so that the default fits on one line * Test whether /var/msgs/bounds is a link before overwriting it * Generally futz around with whitespace
Notes
Notes: svn path=/head/; revision=70109
Diffstat (limited to 'etc')
-rw-r--r--etc/rc65
1 files changed, 35 insertions, 30 deletions
diff --git a/etc/rc b/etc/rc
index 6072cc316fe8..aae3fc53a624 100644
--- a/etc/rc
+++ b/etc/rc
@@ -131,7 +131,7 @@ swapon -a
case ${bootmode} in
autoboot)
- echo Automatic boot in progress...
+ echo 'Automatic boot in progress...'
fsck -p
case $? in
0)
@@ -141,15 +141,15 @@ autoboot)
;;
4)
reboot
- echo "reboot failed... help!"
+ echo 'Reboot failed... help!'
exit 1
;;
8)
- echo "Automatic file system check failed... help!"
+ echo 'Automatic file system check failed... help!'
exit 1
;;
12)
- echo "Reboot interrupted"
+ echo 'Reboot interrupted'
exit 1
;;
130)
@@ -157,13 +157,13 @@ autoboot)
exit 1
;;
*)
- echo "Unknown error in reboot"
+ echo 'Unknown error in reboot'
exit 1
;;
esac
;;
*)
- echo Skipping disk checks ...
+ echo 'Skipping disk checks ...'
;;
esac
@@ -178,7 +178,7 @@ case ${root_rw_mount} in
;;
*)
if ! mount -u -o rw / ; then
- echo "Mounting root filesystem rw failed, startup aborted"
+ echo 'Mounting root filesystem rw failed, startup aborted'
exit 1
fi
;;
@@ -193,7 +193,7 @@ case $? in
0)
;;
*)
- echo "Mounting /etc/fstab filesystems failed, startup aborted"
+ echo 'Mounting /etc/fstab filesystems failed, startup aborted'
exit 1
;;
esac
@@ -222,7 +222,7 @@ yes)
elif [ "${entropy_file}" != /var/db/entropy -a \
-f /var/db/entropy -a -r /var/db/entropy -a \
-s /var/db/entropy ]; then
- echo "Using /var/db/entropy as an entropy file"
+ echo 'Using /var/db/entropy as an entropy file'
cat /var/db/entropy > /dev/random 2> /dev/random
else
echo "Can't use ${entropy_file} as an entropy file, trying other sources"
@@ -295,7 +295,7 @@ case ${swapfile} in
;;
*)
if [ -w "${swapfile}" -a -c /dev/vn0b ]; then
- echo "Adding ${swapfile} as additional swap."
+ echo "Adding ${swapfile} as additional swap"
vnconfig /dev/vn0b ${swapfile} && swapon /dev/vn0b
fi
;;
@@ -338,9 +338,9 @@ esac
# Mount NFS filesystems if present in /etc/fstab
case "`mount -d -a -t nfs`" in
*mount_nfs*)
- echo -n "Mounting NFS file systems"
+ echo -n 'Mounting NFS file systems:'
mount -a -t nfs
- echo .
+ echo '.'
;;
esac
@@ -366,12 +366,13 @@ rm /var/run/clean_var
#
case ${clear_tmp_enable} in
[Yy][Ee][Ss])
- echo clearing /tmp
+ echo -n 'Clearing /tmp:'
# prune quickly with one rm, then use find to clean up /tmp/[lq]*
# (not needed with mfs /tmp, but doesn't hurt there...)
(cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
find -d . ! -name . ! -name lost+found ! -name quota.user \
! -name quota.group -exec rm -rf -- {} \;)
+ echo '.'
;;
esac
@@ -383,7 +384,7 @@ rm -f /tmp/.X*-lock /tmp/.X11-unix/*
# Snapshot any kernel -c changes back to disk here <someday>.
# This has changed with ELF and /kernel.config.
-echo -n 'additional daemons:'
+echo -n 'Additional daemons:'
# Start system logging and name service. Named needs to start before syslogd
# if you don't have a /etc/resolv.conf.
@@ -407,7 +408,7 @@ echo '.'
# Build device name databases if we are not using DEVFS
#
if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
- rm /var/run/dev.db
+ rm -f /var/run/dev.db
else
dev_mkdb
fi
@@ -422,7 +423,7 @@ case ${dumpdev} in
*)
if [ -e "${dumpdev}" -a -d /var/crash ]; then
dumpon -v ${dumpdev}
- echo -n checking for core dump...
+ echo -n 'Checking for core dump: '
savecore /var/crash
fi
;;
@@ -438,13 +439,13 @@ case ${enable_quotas} in
[Yy][Ee][Ss])
case ${check_quotas} in
[Yy][Ee][Ss])
- echo -n 'checking quotas:'
+ echo -n 'Checking quotas:'
quotacheck -a
echo ' done.'
;;
esac
- echo -n 'enabling quotas:'
+ echo -n 'Enabling quotas:'
quotaon -a
echo ' done.'
;;
@@ -464,7 +465,7 @@ fi
case ${accounting_enable} in
[Yy][Ee][Ss])
if [ -d /var/account ]; then
- echo 'turning on accounting'
+ echo 'Turning on accounting:'
if [ ! -e /var/account/acct ]; then
touch /var/account/acct
fi
@@ -491,7 +492,7 @@ if [ -x /sbin/ldconfig ]; then
_LDC="${_LDC} ${i}"
fi
done
- echo 'setting ELF ldconfig path:' ${_LDC}
+ echo 'ELF ldconfig path:' ${_LDC}
${ldconfig} -elf ${_LDC}
;;
esac
@@ -507,7 +508,7 @@ if [ -x /sbin/ldconfig ]; then
_LDC="${_LDC} ${i}"
fi
done
- echo 'setting a.out ldconfig path:' ${_LDC}
+ echo 'a.out ldconfig path:' ${_LDC}
${ldconfig} -aout ${_LDC}
;;
esac
@@ -515,7 +516,7 @@ fi
# Now start up miscellaneous daemons that don't belong anywhere else
#
-echo -n starting standard daemons:
+echo -n 'Starting standard daemons:'
case ${inetd_enable} in
[Nn][Oo])
;;
@@ -567,7 +568,7 @@ echo '.'
find /var/tmp/vi.recover ! -type f -a ! -type d -delete
vibackup=`echo /var/tmp/vi.recover/vi.*`
if [ "${vibackup}" != '/var/tmp/vi.recover/vi.*' ]; then
- echo 'Recovering vi editor sessions'
+ echo -n 'Recovering vi editor sessions:'
for i in /var/tmp/vi.recover/vi.*; do
# Only test files that are readable.
if [ ! -r "${i}" ]; then
@@ -602,12 +603,12 @@ if [ "${vibackup}" != '/var/tmp/vi.recover/vi.*' ]; then
fi
done
fi
+ echo '.'
fi
# Make a bounds file for msgs(1) if there isn't one already
-# "Delete important files with symlink" security hole?
#
-if [ -d /var/msgs -a ! -f /var/msgs/bounds ]; then
+if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then
echo 0 > /var/msgs/bounds
fi
@@ -640,7 +641,7 @@ if [ -r /etc/rc.devfs ]; then
sh /etc/rc.devfs
fi
-echo -n additional ABI support:
+echo -n 'Additional ABI support:'
# Start the Linux binary compatibility if requested.
#
@@ -664,7 +665,7 @@ case ${svr4_enable} in
;;
esac
-echo .
+echo '.'
# Do traditional (but rather obsolete) rc.local file if it exists. If you
# use this file and want to make it programmatic, source /etc/defaults/rc.conf
@@ -684,7 +685,7 @@ echo .
# ---- rc.local ----
#
if [ -r /etc/rc.local ]; then
- echo -n 'starting local daemons:'
+ echo -n 'Starting local daemons:'
sh /etc/rc.local
echo '.'
fi
@@ -707,7 +708,7 @@ case ${local_startup} in
done
fi
done
- echo .
+ echo '.'
;;
esac
@@ -721,11 +722,15 @@ fi
case ${kern_securelevel_enable} in
[Yy][Ee][Ss])
if [ "${kern_securelevel}" -ge 0 ]; then
- echo 'Raising kernel security level'
+ echo 'Raising kernel security level: '
sysctl -w kern.securelevel=${kern_securelevel}
fi
;;
esac
+echo ''
+
date
+
exit 0
+