LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2018, 01:07 AM   #1
jogyulas
Member
 
Registered: May 2014
Location: Hungary
Posts: 32

Rep: Reputation: Disabled
kernel time is difference from system time


Hi Guys,

I have a question. I have just noticed in logging files that my kernel time is difference from system time. Is it okay or not? I tried to solve this problem by google but I didnt find solution for it.

Can you help me and/or explain me why is not same?

Ty,
 
Old 06-14-2018, 01:41 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,810
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
Is your PC multiboot with Windows? What does /etc/adjtime contain? LOCAL rather than UTC should explain the difference.
 
Old 06-14-2018, 02:12 AM   #3
jogyulas
Member
 
Registered: May 2014
Location: Hungary
Posts: 32

Original Poster
Rep: Reputation: Disabled
Hi mrmazda,

Ty for your quick response. The Debian OS runs on a server so it is a single boot.
Code:
cat /etc/adjtime
0.000010 1528955839 0.000000
1528955839
UTC

date
Thu Jun 14 09:08:12 CEST 2018
Q2: do you have a Mazda?
 
Old 06-14-2018, 02:39 AM   #4
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,810
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
What does /etc/localtime link to? What is your local time zone, +0200? Is that how much difference you see in the logs?
 
Old 06-14-2018, 03:02 AM   #5
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 510

Rep: Reputation: 58
it's not called kernel time and system time for no reason: they will differ a _little

the system (libc) gets time from the kernel at the time the application asks for the time, the kernel takes time from the hardware (most kernels are configured that way, anyhow)


it's possible for an application or even libc to get delayed in showing you the time after it obtains it from the kernel
 
Old 06-14-2018, 04:12 AM   #6
jogyulas
Member
 
Registered: May 2014
Location: Hungary
Posts: 32

Original Poster
Rep: Reputation: Disabled
@mrmazda: if I understand well what you would like to see here it is:
Code:
ls -l /etc/localtime
-rw-r--r-- 1 root root 2379 Jun 14 07:47 /etc/localtime
I have also tried to reconfigure my timezone with tzdata, but my system time is ok
Code:
Current default time zone: 'Europe/Budapest'
Local time is now:      Thu Jun 14 10:57:32 CEST 2018.
Universal Time is now:  Thu Jun 14 08:57:32 UTC 2018.
Difference between the two times is about 30 minutes but it isnt exact. And just to present the problem it is a snippet from my syslog file:
Code:
Jun 14 11:00:01 x zfs-snapshot: executing zfs snapshot pool/storage@auto-201806140900-UTC
Jun 14 11:00:02 x zfs-snapshot: executing zfs destroy pool/storage@auto-201806070900-UTC
Jun 14 10:37:55 x kernel: tg3 0000:03:00.0 eth0: Link is down
Jun 14 10:37:59 x kernel: tg3 0000:03:00.0 eth0: Link is up at 1000 Mbps, full duplex
Jun 14 10:37:59 x kernel: tg3 0000:03:00.0 eth0: Flow control is on for TX and on for RX
Jun 14 10:37:59 x kernel: tg3 0000:03:00.0 eth0: EEE is enabled
Jun 14 11:06:03 x syslog-ng[52107]: syslog-ng shutting down; version='3.5.6'
Jun 14 11:06:03 x syslog-ng[3008]: syslog-ng starting up; version='3.5.6'
As you can see logging from kernel uses different timestamps. It happens too when iptables logs into other logging files.


@X-LFS-2010: Ty for your response too
I understand what you write and I have checked my server time on iLO which shows the right time (aside from +2 hours):
Code:
iLO Date/Time:	Thu Jun 14 08:57:32 2018

Last edited by jogyulas; 06-14-2018 at 04:20 AM.
 
Old 06-19-2018, 08:29 AM   #7
jogyulas
Member
 
Registered: May 2014
Location: Hungary
Posts: 32

Original Poster
Rep: Reputation: Disabled
Hi,

It seems I have found it, and it also seems that this problem is caused by syslog-ng. Perhaps it is a bug :/ I need to upgrade syslog-ng pkg.

Last edited by jogyulas; 06-19-2018 at 08:31 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] File time stamp and time as printed by date showing difference MahendraL Linux - Newbie 9 04-19-2015 05:02 AM
[SOLVED] The system time switches the time zone automatically but doesn't change the time RandomTroll Linux - Software 9 03-15-2013 12:28 PM
Difference between system uptime and last boot time. pinga123 Linux - Newbie 2 05-11-2011 08:38 PM
Setting System Time: kernel in wrong time zone warrenweiss Linux - General 7 05-15-2004 03:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration