aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2014-07-23 16:19:25 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2014-07-24 17:40:14 -0500
commite3bfb68aece9378a0669c2893285808100fd5ea6 (patch)
treeeded9b5b993a69696babf00d803a5d3dc37cd089
parent1f7582c78b2697c3f2617a4a89afabaf3550b0fb (diff)
hwclock: always set the kernel's timezone
The hwclock service should set the time zone regardless of the setting of the clock_hctosys variable. This needs to be done to prevent issues when the system time is being synchronized using ntp. X-Gentoo-Bug: 434410 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=434410
-rw-r--r--init.d/hwclock.in17
1 files changed, 6 insertions, 11 deletions
diff --git a/init.d/hwclock.in b/init.d/hwclock.in
index 823a5ab2..4b0da02c 100644
--- a/init.d/hwclock.in
+++ b/init.d/hwclock.in
@@ -83,22 +83,17 @@ start()
fi
fi
+ # Always set the kernel's time zone.
+ _hwclock --systz $utc_cmd $clock_args
+ : $(( retval += $? ))
+
if [ -e /etc/adjtime ] && yesno $clock_adjfile; then
_hwclock --adjust $utc_cmd
: $(( retval += $? ))
fi
- # If setting UTC, don't bother to run hwclock when first booting
- # as that's the default
- if [ "$PREVLEVEL" != N -o \
- "$utc_cmd" != --utc -o \
- -n "$clock_args" ];
- then
- if yesno ${clock_hctosys:-YES}; then
- _hwclock --hctosys $utc_cmd $clock_args
- else
- _hwclock --systz $utc_cmd $clock_args
- fi
+ if yesno ${clock_hctosys:-YES}; then
+ _hwclock --hctosys $utc_cmd $clock_args
: $(( retval += $? ))
fi