From e3bfb68aece9378a0669c2893285808100fd5ea6 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Wed, 23 Jul 2014 16:19:25 -0500 Subject: [PATCH] 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 --- init.d/hwclock.in | 17 ++++++----------- 1 file 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