系统相关
首页 > 系统相关> > linux – kern.log中“00:00:00”时间戳的含义是什么?

linux – kern.log中“00:00:00”时间戳的含义是什么?

作者:互联网

我正在寻找kern.log中特定问题的原因.有许多条目的00:00:00时间戳:

Jun 11 00:00:00 mymachine kernel: [    0.000000] Initializing cgroup subsys cpusetJun 11 00:00:00 mymachine kernel: [    0.000000] Initializing cgroup subsys cpu
Jun 11 00:00:00 mymachine kernel: [    0.000000] Linux version 3.2.0-33-virtual (buildd@batsu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #52-Ubuntu SMP Thu Oct 18 16:48:3
7 UTC 2012 (Ubuntu 3.2.0-33.52-virtual 3.2.31)
Jun 11 00:00:00 mymachine kernel: [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-33-virtual root=LABEL=cloudimg-rootfs ro console=ttyS0

假设我实际上没有在午夜启动机器 – 00:00:00时间戳是否意味着启动过程的特定阶段?他们这样做有什么特别的原因?

(这是一个托管在OpenStack上的Ubuntu Precise VM,如果这很重要的话.我认为这个启动是在从另一个图像克隆后立即启动的.)

编辑更多信息:

据我所知(pgrep ntp,ls / etc / ntp *)ntp没有运行.

时间似乎(正确)设置为UTC,(错误地)没有设置本地时区.

EDIT2 00:00:00的最后一个日志条目如下所示:

Jun 11 00:00:00 mymachine kernel: [    6.324599] type=1400 audit(1370908796.761:11): apparmor="STATUS" operation="profile_load" name="/usr/sbin/tcpdump" pid=875 comm="apparmor_parser"
Jun 11 00:00:02 mymachine kernel: [   12.259133] postgres (1033): /proc/1033/oom_adj is deprecated, please use /proc/1033/oom_score_adj instead.
Jun 11 00:00:05 mymachine kernel: [   13.592385] eth0: no IPv6 routers present
Jun 11 06:22:15 mymachine kernel: [22942.768233] init: tilemill main process (3167) killed by TERM signal
Jun 11 06:40:14 mymachine kernel: [24022.599001] init: tilemill main process (5640) killed by TERM signal

解决方法:

看看这个其他的Unix& Linux问题标题为:Correlating /var/log/* timestamps.

时序详细信息/分辨率由在引导期间传递给内核的设置控制:

$grep PRINTK /boot/config-`uname -r`
CONFIG_PRINTK=y
CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_PRINTK_TIME=y
CONFIG_BOOT_PRINTK_DELAY=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_PRINTK_DBGP=y

您可以在kernel.org git repo中阅读有关这些选项的更多信息.

摘自上面的页面

config PRINTK_TIME

06001

Selecting this option causes time stamps of the printk() messages to
be added to the output of the syslog() system call and at the console.

The timestamp is always recorded internally, and exported to /dev/kmsg.
This flag just specifies if the timestamp should be included, not that
the timestamp is recorded.

The behavior is also controlled by the kernel command line parameter
printk.time=1. See Documentation/kernel-parameters.txt

时间戳[0.000000]以系统引导后的秒数表示.

标签:linux,kernel,boot,logs,timestamps
来源: https://codeday.me/bug/20190812/1642669.html