Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung Nächste Überarbeitung Beide Seiten, nächste Überarbeitung | ||
admin_grundlagen:uhrzeit [2015/04/08 08:16] ingo_wichmann [systemd timedatectl] |
admin_grundlagen:uhrzeit [2023/05/04 10:14] ingo_wichmann [Kernel] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== Hardware ====== | ||
+ | ===== x86 CPU ===== | ||
+ | Hat die CPU einen Constant Time Stamp Counter (TSC)? | ||
+ | grep -o constant_tsc /proc/cpuinfo | ||
+ | |||
+ | Wird er benutzt? | ||
+ | journalctl -kg 'tsc|clocksource' | ||
+ | |||
+ | ====== Kernel ====== | ||
+ | Der Linux Kernel stellt u.a. folgende Devices als Zeitquellen zur Verfügung | ||
+ | |||
+ | Real Time Clock: | ||
+ | * ''/dev/rtc*'' | ||
+ | |||
+ | Precision Time Protocol (für Virtualisierungsgäste) | ||
+ | |||
+ | modprobe ptp_kvm | ||
+ | |||
+ | * ''/dev/ptp*'' | ||
+ | |||
+ | siehe auch [[chrony#precision_time_protocol_ptp_im_kvm_gast]] | ||
====== Systemuhr stellen ====== | ====== Systemuhr stellen ====== | ||
===== date ===== | ===== date ===== | ||
Zeile 11: | Zeile 32: | ||
date | date | ||
===== systemd timedatectl ===== | ===== systemd timedatectl ===== | ||
+ | timedatectl set-time '2006-03-26 01:59:30' | ||
+ | (( | ||
+ | oder (ab systemd Version 213) | ||
+ | ''/etc/systemd/timesyncd.conf'' : | ||
+ | <file> | ||
+ | [Time] | ||
+ | NTP=0.de.pool.ntp.org 1.de.pool.ntp.org 2.de.pool.ntp.org | ||
+ | FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org | ||
+ | </file> | ||
+ | timedatectl set-ntp true | ||
+ | )) | ||
- | Zeiteinstellungen ansehen: | + | Überprüfen: |
timedatectl | timedatectl | ||
- | |||
====== Hardwareuhr stellen ====== | ====== Hardwareuhr stellen ====== | ||
+ | ===== hwclock ===== | ||
Die Hardwareuhr auf UTC einstellen: | Die Hardwareuhr auf UTC einstellen: | ||
hwclock --systohc --utc | hwclock --systohc --utc | ||
Zeile 25: | Zeile 57: | ||
Überprüfen: | Überprüfen: | ||
hwclock --show | hwclock --show | ||
+ | |||
+ | ===== timedatectl ===== | ||
+ | Die Hardwareuhr auf UTC einstellen: | ||
+ | timedatectl set-local-rtc 0 | ||
+ | |||
+ | Die Hardwareuhr auf lokale Zeit einstellen: | ||
+ | timedatectl set-local-rtc 1 | ||
+ | | ||
+ | Überprüfen: | ||
+ | timedatectl status | ||
====== Zeitzone einstellen ====== | ====== Zeitzone einstellen ====== | ||
Zeile 32: | Zeile 74: | ||
oder | oder | ||
date | date | ||
+ | oder | ||
+ | timedatectl status | ||
- | === Doku === | + | ==== timedatectl ==== |
- | man tzfile | + | CentOS (ab 7), Debian (ab 8), openSuSE (ab 13.1) |
- | ==== Debian ==== | + | timedatectl set-timezone Europe/Berlin |
- | Debian ab 3.1 | + | |
- | tzconfig | + | |
- | Debian ab 5.0 | + | |
- | dpkg-reconfigure tzdata | + | |
- | + | ||
- | Mehr Informationen: | + | |
- | http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html | + | |
- | ==== SuSE ==== | + | ==== SuSE (bis SLES 11) ==== |
''/etc/sysconfig/clock'' : | ''/etc/sysconfig/clock'' : | ||
<file> | <file> | ||
Zeile 53: | Zeile 90: | ||
</file> | </file> | ||
- | ==== CentOS / RedHat ==== | + | ==== CentOS / RedHat (bis 6.0) ==== |
''/etc/sysconfig/clock'' : | ''/etc/sysconfig/clock'' : | ||
<file> | <file> | ||
Zeile 60: | Zeile 97: | ||
</file> | </file> | ||
+ | ==== Debian (bis 7) ==== | ||
+ | Debian ab 5.0 | ||
+ | dpkg-reconfigure tzdata | ||
+ | |||
+ | Mehr Informationen: | ||
+ | http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html | ||
- | ==== Debian (?) ==== | ||
''/etc/default/rcS'' : | ''/etc/default/rcS'' : | ||
<file> | <file> |