ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Sergey <a_s_y@sama.ru>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: Re: [Comm] Опять системное время и таймзона.
Date: Tue, 16 Jun 2015 12:39:31 +0400
Message-ID: <201506161239.31205.a_s_y@sama.ru> (raw)
In-Reply-To: <201505251540.32055.a_s_y@sama.ru>

On Monday 25 May 2015, Sergey wrote:

> May 25 15:13:11 kernel: Kernel log daemon terminating.
> May 25 15:13:12 klogd: klogd shutdown succeeded
> May 25 15:13:13 exiting on signal 15
> May 25 19:14:31 syslogd 1.4.1: restart.
> May 25 19:14:31 syslogd: syslogd startup succeeded
 
В общем, это колдунство обнаружилось в районе опций hwclock и

 -u, --utc            the hardware clock is kept in UTC
     --localtime      the hardware clock is kept in local time

и, как следствие /etc/adjtime, который формируется при их
использовании. 

# date
Tue Jun 16 11:30:51 SAMT 2015
# /sbin/hwclock --systohc --localtime
# rm -f /etc/adjtime
# /sbin/hwclock -r
Tue Jun 16 15:31:22 2015  -0.004740 seconds

То есть, с опцией --localtime время в RTC выставилось на +4
от локального, то есть, на саму величину смещения локального
от UTC (у меня SAMT - оно +4).

С опцией --utc в RTC попадает локальное время, а, вовсе, не UTC:

# /sbin/hwclock --systohc --utc
# rm -f /etc/adjtime
# /sbin/hwclock -r
Tue Jun 16 11:33:52 2015  -0.213865 seconds

Далее, вопрос установки времени переходит к /etc/sysconfig/clock,
к параметру HWCLOCK_SET_TIME_AT_START. Если значение true, то 
системное время выставляется на минус смещение таймзоны от RTC.
То есть, если в RTC локальное время, то системное будет UTC, а
если в RTC двойное смещение по таймзоне, то системное будет локальным.

Спрашивается: а зачем и где тут логика !? 

Итого, чтобы время было правильным после загрузки, надо выполнить
одно из двух.

Вариант 1 (в RTC двойное смещение по таймзоне):
/sbin/hwclock --systohc --localtime
sed "s/^HWCLOCK_SET_TIME_AT_START.*/HWCLOCK_SET_TIME_AT_START=true/" -i /etc/sysconfig/clock

Вариант 2 (в RTC localtime):
/sbin/hwclock --systohc --utc
sed "s/^HWCLOCK_SET_TIME_AT_START.*/HWCLOCK_SET_TIME_AT_START=false/" -i /etc/sysconfig/clock

Остальные значения параметров с /etc/sysconfig/clock, в этом
эксперименте, всегда были такие:

HWCLOCK_SET_AT_HALT=false
HWCLOCK_ADJUST=false
UTC=false
ZONE=Europe/Samara

-- 
С уважением, Сергей.


  parent reply	other threads:[~2015-06-16  8:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 11:40 Sergey
2015-05-26  4:49 ` Sergey
2015-06-16  8:39 ` Sergey [this message]
2015-06-16 10:17   ` Sergey
2015-06-17 10:35     ` Kharitonov A. Dmitry
2015-06-17 12:32       ` Sergey
2015-06-18 13:51         ` Kharitonov A. Dmitry
2015-06-18 14:11           ` Sergey
2015-06-18 14:34             ` Kharitonov A. Dmitry
2015-06-19  6:56               ` Sergey
2015-06-18 14:43             ` Mikhail Efremov
2015-06-19  6:52               ` Sergey
2015-06-20 12:50                 ` Kharitonov A. Dmitry
2015-06-20 16:17                   ` Sergey
2015-06-20 17:06                     ` Sergey
2015-06-21 15:14                       ` Kharitonov A. Dmitry
2015-06-21 18:16                         ` Sergey
2015-06-25 10:11                           ` Kharitonov A. Dmitry
2015-06-26  6:58                             ` Sergey
2015-06-26 10:10                               ` Kharitonov A. Dmitry
2015-06-26 10:45                                 ` Sergey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201506161239.31205.a_s_y@sama.ru \
    --to=a_s_y@sama.ru \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git