diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2014-07-23 16:19:25 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2014-07-24 17:40:14 -0500 |
commit | e3bfb68aece9378a0669c2893285808100fd5ea6 (patch) | |
tree | eded9b5b993a69696babf00d803a5d3dc37cd089 | |
parent | 1f7582c78b2697c3f2617a4a89afabaf3550b0fb (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.in | 17 |
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 |