31

Макс1,
Проверка: Сделать несколько перезагрузок туда-сюда.

32

Дело не в этом. У меня есть и DOS, там то же самое. Время в BIOS уходит на 4 часа назад после загрузки openSUSE, если оно было правильным, а если уже -4 часа, таким и остается. Похоже, что время устанавливается по NTP - правильное программное и аппаратное -4 часа.

33

Макс1,
Проверьте:
1) Отключить NTP
Применить следующее:
Это:

# echo -e "0.0 0 0.0\n0\nLOCAL" > /etc/adjtime

и ещё это: OpenSUSE 12.2 и часы
2) Настроить время
3) Перезагрузки туда-сюда

34

Макс1,
Кстати покажите:

cat /etc/sysconfig/clock

35

cat /etc/sysconfig/clock

+ открыть спойлер

## Path:                System/Environment/Clock
## Description:         Information about your timezone and time
#
# Be aware that the time reference of the CMOS/HW clock has been
# forwarded to /etc/adjtime, the file used by hwclock(8),
# systemd(1), and the kernel as reference for the CMOS/HW clock.

## Type:                list(yes,no,)
## Description:         Write back system time to the hardware clock
#
# Is set to "yes" write back the system time to the hardware
# clock at reboot or shutdown. Usefull if hardware clock is
# much more inaccurate than system clock.  Set to "no" if
# system time does it wrong due e.g. missed timer interrupts.
# If set to "no" the hardware clock adjust feature is also
# skipped because it is rather useless without writing back
# the system time to the hardware clock.
#
# Note that you need to enable boot.clock for this feature to take
# effect.
#
# defaults to 'yes' if unset
#
SYSTOHC=""

## Type:                list(no,yes)
## Description:         Write back system time if if already done by kernel
#
# Is set to "yes" write back the system time to the hardware
# clock at reboot or shutdown eveb if this is done by the kernel
# in the so called ``Eleven Minute Mode''.
#
FORCE_SYSTOHC="no"                                                                                                                                                               
                                                                                                                                                                                 
## Type:                string                                                                                                                                                   
## Type:                list(yes,no)                                                                                                                                             
## Description:         HW clock is not able to use years outside 1994-1999.                                                                                                     
#                                                                                                                                                                                 
# Indicates that the Hardware Clock is incapable of storing years                                                                                                                 
# outside the range 1994-1999.                                                                                                                                                   
#                                                                                                                                                                                 
BADYEAR="no"                                                                                                                                                                     
                                                                                                                                                                                 
## Type:                string                                                                                                                                                   
## Description:         Overrides the default device file name                                                                                                                   
#                                                                                                                                                                                 
# Overrides the default /dev file name, which is /dev/rtc on many                                                                                                                 
# platforms but may be /dev/rtc0, /dev/rtc1, and so on.                                                                                                                           
#                                                                                                                                                                                 
HCTOSYS_DEVICE=""                                                                                                                                                                 
                                                                                                                                                                                 
## Type:                list(yes,no,)                                                                                                                                             
## Description:         Do or do not not run hwclock(8)                                                                                                                           
#                                                                                                                                                                                 
# Set this to yes if it is possible to access the hardware clock,                                                                                                                 
# or no if it is not.  On some platforms (s390 or xen) this may                                                                                                                   
# overwritten by the service its self.
#
USE_HWCLOCK="yes"

## Type:                list(yes,no,)
## Description:         Correct systematic drift of the HW clock
#
# Add or subtract time from the Hardware Clock to account for
# systematic drift since the last time the clock was set or
# adjusted. By default off as this can cause trouble.  For
# systems using localtime for HW clock this will ignored.
#
USE_ADJUST="no"

## Type:                string(Europe/Berlin,Europe/London,Europe/Paris)
## ServiceRestart:      boot.clock
## Command:             /sbin/refresh_initrd
#
# Timezone (e.g. CET or Asia/Tokyo). The value should correspond
# to the contents of the /etc/localtime file and is for internal
# YaST use; changing this setting will not make SuSEconfig update
# the /etc/localtime file, YaST does that or you will need to do
# this manually by calling zic -l.
#
TIMEZONE="Europe/Moscow"
DEFAULT_TIMEZONE="US/Eastern"

36

Макс1 пишет:

TIMEZONE="Europe/Moscow"
DEFAULT_TIMEZONE="US/Eastern"

Измените на это:

TIMEZONE="Europe/Moscow"
DEFAULT_TIMEZONE="Europe/Moscow"


и ещё:

FORCE_SYSTOHC="no"

на

FORCE_SYSTOHC="yes"



Потом:

# mkinitrd

37 (17.10.2012 03:13:15 отредактировано Макс1)

Получается так, что при любых настройках при включенном NTP время в BIOS уходит на 4 часа назад. Раньше, после того, как была решена проблема с уходом времени на 4 часа вперед, такого некоторое время не было. Если отключить NTP, такого сейчас нет. По крайней мере, после:

echo -e "0.0 0 0.0\n0\nLOCAL" > /etc/adjtime
mkinitrd

Непонятно, как вернуть такое, чтобы не было рассогласования программных и аппаратных часов при включенном NTP.

38

Макс1,
Включите NTP через Яст - настройте время -  синхронизируйте вручную
Далее выполните:

# sed -i 's/utc/localtime/g' /etc/init.d/ntp

Потом перезагрузиться.


з.ы. На себе проверил:

localhost:/home/verg # date
Ср. окт. 17 03:56:35 MSK 2012
localhost:/home/verg # hwclock
Ср. 17 окт. 2012 03:56:42  -0.833372 секунд

39

# sed -i 's/utc/localtime/g' /etc/init.d/ntp

Да, это работает, сейчас нормально при включенном NTP. Спасибо.

40

Макс1 пишет:

Да, это работает

Просто скрипт ntp в openSUSE оказался немного глупеньким.


з.ы. ну, вроде все случаи, связанные со временем, разобрали в этой теме.
Отправлю в решенные.