aboutsummaryrefslogtreecommitdiff
path: root/init.d.BSD/clock
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-07-04 18:11:01 +0000
committerRoy Marples <roy@marples.name>2007-07-04 18:11:01 +0000
commit31a9682c98005b4c8f37c37fb7bd50fad21b7115 (patch)
tree51f3d806f3668cecad624c8cef472c3e799584dd /init.d.BSD/clock
parent710a67138f7efc4c3442fbbc1a37e1d7191f6a24 (diff)
Allow syncing of hwlock for BSD and make our config files look fairly similar.
Diffstat (limited to 'init.d.BSD/clock')
-rwxr-xr-xinit.d.BSD/clock13
1 files changed, 13 insertions, 0 deletions
diff --git a/init.d.BSD/clock b/init.d.BSD/clock
index 71d170ee..0baa2884 100755
--- a/init.d.BSD/clock
+++ b/init.d.BSD/clock
@@ -2,6 +2,8 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+opts="save"
+
depend() {
# BSD adjkerntz needs to be able to write to /etc
if [ "${CLOCK}" = "UTC" -a -e /etc/wall_cmos_clock ] ||
@@ -28,7 +30,18 @@ start() {
eend $?
}
+save() {
+ local TBLURB="Local Time"
+ [ "${CLOCK}" = "UTC" ] && TBLURB="UTC"
+ ebegin "Setting hardware clock using the system clock" "[${TBLURB}]"
+ adjkerntz -a
+ eend $?
+}
+
stop() {
+ # Don't tweak the hardware clock on LiveCD halt.
+ [ -z "${CDBOOT}" -a "${CLOCK_SYSTOHC}" = "yes" ] && save
+
ebegin "Stopping the System Clock Adjuster"
if start-stop-daemon --test --quiet --stop --exec /sbin/adjkerntz ; then
start-stop-daemon --stop --exec /sbin/adjkerntz