aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-01-23 21:24:50 +0000
committerBill Nottingham <notting@redhat.com>2001-01-23 21:24:50 +0000
commit906115db10d72592fecab5fb2a35e684cb39055a (patch)
tree2630aeee9e887550ebfa6af84f286abe4f751ac4
parent449aafc07527f8c530e7c9576e31d412a331a030 (diff)
downloadinitscripts-906115db10d72592fecab5fb2a35e684cb39055a.tar
initscripts-906115db10d72592fecab5fb2a35e684cb39055a.tar.gz
initscripts-906115db10d72592fecab5fb2a35e684cb39055a.tar.bz2
initscripts-906115db10d72592fecab5fb2a35e684cb39055a.tar.xz
initscripts-906115db10d72592fecab5fb2a35e684cb39055a.zip
read /etc/sysconfig/clock on syncing hwclock
-rwxr-xr-xrc.d/init.d/halt46
1 files changed, 44 insertions, 2 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index 96cf2a46..347c596b 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -56,8 +56,50 @@ if [ $? = 0 -a -x /bin/aumix-minimal ]; then
runcmd $"Saving mixer settings" /bin/aumix-minimal -f /etc/.aumixrc -S
fi
-# Sync clock
-runcmd $"Syncing hardware clock to system time" /sbin/hwclock --systohc
+# Sync 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=""
+CLOCKFLAGS="--systohc"
+
+case "$UTC" in
+ yes|true)
+ CLOCKFLAGS="$CLOCKFLAGS -u";
+ CLOCKDEF="$CLOCKDEF (utc)";
+ ;;
+ no|false)
+ CLOCKFLAGS="$CLOCKFLAGS --localtime";
+ CLOCKDEF="$CLOCKDEF (localtime)";
+ ;;
+esac
+
+case "$ARC" in
+ yes|true)
+ CLOCKFLAGS="$CLOCKFLAGS -A";
+ CLOCKDEF="$CLOCKDEF (arc)";
+ ;;
+esac
+case "$SRM" in
+ yes|true)
+ CLOCKFLAGS="$CLOCKFLAGS -S";
+ CLOCKDEF="$CLOCKDEF (srm)";
+ ;;
+esac
+
+runcmd $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
# Turn off swap, then unmount file systems.
SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps`