diff options
-rw-r--r-- | initscripts.spec | 3 | ||||
-rwxr-xr-x | rc.d/rc.sysinit | 124 |
2 files changed, 68 insertions, 59 deletions
diff --git a/initscripts.spec b/initscripts.spec index 8deb6c70..f1533cce 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -7,7 +7,8 @@ Group: System Environment/Base Release: 1 Source: initscripts-%{version}.tar.gz BuildRoot: /var/tmp/initbld -Requires: mingetty, bash, /bin/awk, /bin/sed, mktemp, e2fsprogs, console-tools, procps, modutils >= 2.1.85-3, sysklogd >= 1.3.31 +Requires: mingetty, bash, /bin/awk, /bin/sed, mktemp, e2fsprogs, console-tools +Requires: procps, modutils >= 2.1.85-3, sysklogd >= 1.3.31, timeconfig >= 3.0 Conflicts: kernel <= 2.2 Prereq: /sbin/chkconfig, /usr/sbin/groupadd 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 |