aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-06-22 02:26:22 +0000
committerBill Nottingham <notting@redhat.com>1999-06-22 02:26:22 +0000
commitf23d2bfda2b11b576be3e46c0deafb94ae1f3f99 (patch)
treecca249fb3a193c77f86f7605793bc30b091e7b0d /rc.d
parent4822ea7a03e02d0a51b78fc603d580103983d04c (diff)
downloadinitscripts-f23d2bfda2b11b576be3e46c0deafb94ae1f3f99.tar
initscripts-f23d2bfda2b11b576be3e46c0deafb94ae1f3f99.tar.gz
initscripts-f23d2bfda2b11b576be3e46c0deafb94ae1f3f99.tar.bz2
initscripts-f23d2bfda2b11b576be3e46c0deafb94ae1f3f99.tar.xz
initscripts-f23d2bfda2b11b576be3e46c0deafb94ae1f3f99.zip
always set clock first thing (req. timeconfig 3.0)
touch utmpx/wtmpx if needed
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/rc.sysinit124
1 files changed, 66 insertions, 58 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index efe48b75..2f3cfbc3 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -25,69 +25,61 @@ fi
# Source functions
. /etc/rc.d/init.d/functions
-set_the_clock() {
- # Set the system clock.
- _CLOCK_SET=1
- ARC=0
- SRM=0
- UTC=0
- if [ -f /etc/sysconfig/clock ]; then
- . /etc/sysconfig/clock
-
- # convert old style clock config to new values
- if [ "${CLOCKMODE}" = "GMT" ]; then
- UTC=true
- elif [ "${CLOCKMODE}" = "ARC" ]; then
- ARC=true
- fi
- fi
+# Fix console loglevel
+/sbin/loglevel $LOGLEVEL
- CLOCKDEF=""
- if [ -x /sbin/hwclock ]; then
- CLOCKFLAGS="--hctosys"
- CLOCK=/sbin/hwclock
- else
- CLOCKFLAGS="-a"
- CLOCK=/sbin/clock
- fi
+# Set the system clock.
+ARC=0
+SRM=0
+UTC=0
+if [ -f /etc/sysconfig/clock ]; then
+ . /etc/sysconfig/clock
+
+ # convert old style clock config to new values
+ if [ "${CLOCKMODE}" = "GMT" ]; then
+ UTC=true
+ elif [ "${CLOCKMODE}" = "ARC" ]; then
+ ARC=true
+ fi
+fi
+
+CLOCKDEF=""
+if [ -x /sbin/hwclock ]; then
+ CLOCKFLAGS="--hctosys"
+ CLOCK=/sbin/hwclock
+else
+ CLOCKFLAGS="-a"
+ CLOCK=/sbin/clock
+fi
- case "$UTC" in
- yes|true)
- CLOCKFLAGS="$CLOCKFLAGS -u";
- CLOCKDEF="$CLOCKDEF (utc)";
- ;;
- esac
+case "$UTC" in
+ yes|true)
+ CLOCKFLAGS="$CLOCKFLAGS -u";
+ CLOCKDEF="$CLOCKDEF (utc)";
+ ;;
+esac
- if [ "$CLOCK" = "/sbin/clock" ]; then
- case "$ARC" in
- yes|true)
+if [ "$CLOCK" = "/sbin/clock" ]; then
+ case "$ARC" in
+ yes|true)
CLOCKFLAGS="$CLOCKFLAGS -A";
CLOCKDEF="$CLOCKDEF (arc)";
- ;;
- esac
- case "$SRM" in
- yes|true)
+ ;;
+ esac
+ case "$SRM" in
+ yes|true)
CLOCKFLAGS="$CLOCKFLAGS -S";
CLOCKDEF="$CLOCKDEF (srm)";
- ;;
- esac
- fi
-
- $CLOCK $CLOCKFLAGS
-
- action "Setting clock $CLOCKDEF: `date`" date
-}
+ ;;
+ esac
+fi
-# Fix console loglevel
-/sbin/loglevel $LOGLEVEL
+$CLOCK $CLOCKFLAGS
-_CLOCK_SET=0
-# Set clock, if we can...
-if [ -f /etc/localtime ] || cat /etc/localtime >/dev/null 2>&1; then
- set_the_clock
-fi
+action "Setting clock $CLOCKDEF: `date`" date
# Load keymap
+_LOADED_KEYMAP=
KEYMAP=
if [ -f /etc/sysconfig/console/default.kmap ]; then
KEYMAP=/etc/sysconfig/console/default.kmap
@@ -103,13 +95,22 @@ if [ -n "$KEYMAP" ]; then
loadkeys $KEYMAP < /dev/tty0 > /dev/tty0 2>/dev/null && \
success "Loading default keymap" || failure "Loading default keymap"
echo
+ if [ -f /etc/sysconfig/console/local.kmap* ]; then
+ echo -n "Loading local keymap modifiers"
+ loadkeys local < /dev/tty0 > /dev/tty0 2>/dev/null && \
+ success "Loading local keymap modifiers" || failure "Loading local keymap modifiers"
+ echo
+ fi
+ _LOADED_KEYMAP=yes
fi
# Load system font
+_LOADED_FONT=
if [ -x /sbin/setsysfont ]; then
. /etc/sysconfig/i18n
if [ -f /etc/sysconfig/console/$SYSFONT.psf.gz -o -f /usr/lib/kbd/consolefonts/$SYSFONT.psf.gz ]; then
action "Setting default font" /sbin/setsysfont
+ _LOADED_FONT=yes
fi
fi
@@ -199,11 +200,13 @@ action "Remounting root filesystem in read-write mode" mount -n -o remount,rw /
if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then
action "Checking root filesystem quotas" /sbin/quotacheck -v /
fi
+
# XXX Disabled to avoid complaints on root later with quotaon -a
#if [ -x /sbin/quotaon ]; then
# action "Turning on user and group quotas for root filesystem" /sbin/quotaon /
#fi
+# The root filesystem is now read-write, so we can now log via syslog() directly..
if [ -n "$IN_INITLOG" ]; then
IN_INITLOG=
fi
@@ -226,7 +229,7 @@ else
fi
# Our modutils don't support it anymore, so we might as well remove
-# the link.
+# the preferred link.
rm -f /lib/modules/preferred
rm -f /lib/modules/default
if [ -x /sbin/depmod -a -n "$USEMODULES" ]; then
@@ -354,6 +357,10 @@ fi
# Clean out /etc.
rm -f /etc/mtab~ /fastboot /fsckoptions /forcefsck
+# Do we need (w|u)tmpx files? We don't set them up, but the sysadmin might...
+_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
@@ -369,6 +376,12 @@ done
touch /var/log/wtmp
chgrp utmp /var/run/utmp /var/log/wtmp
chmod 0664 /var/run/utmp /var/log/wtmp
+if [ -n "$NEED_XFILES" ]; then
+ >/var/run/utmpx
+ touch /var/log/wtmpx
+ chgrp utmp /var/run/utmpx /var/log/wtmpx
+ chmod 0664 /var/run/utmpx /var/log/wtmpx
+fi
# Delete X locks
rm -f /tmp/.X*-lock
@@ -376,11 +389,6 @@ rm -f /tmp/.X*-lock
# Delete Postgres sockets
rm -f /tmp/.s.PGSQL.*
-# If we didn't set the clock before, set it now...
-if [ "$_CLOCK_SET" != "1" ]; then
- set_the_clock
-fi
-
# Right, now turn on swap in case we swap to files.
swapon -a >/dev/null 2>&1
action "Enabling swap space" /bin/true