14

I have a small server running centos 6.4 and it is working quite nicely for some time. One thing that still bugs me is that the time in my log files is different then the time the 'date' command displays.

For example:

date
Thu May  9 13:39:04 BST 2013

And when i login with ssh i get a log entry in secure log:

May  9 08:37:08 xxxx sshd[28612]: pam_unix(sshd:session): session opened for user root by

The time difference seem to be always 5 hours. Which makes me think it is something timezone related.

My hwclock

cat /etc/sysconfig/clock 
ZONE="Europe/London"

My localtime

ls -al /etc/localtime 
lrwxrwxrwx 1 root root 33 Apr  2 15:13 /etc/localtime -> /usr/share/zoneinfo/Europe/London

My hwclock output

hwclock
Thu 09 May 2013 01:41:40 PM BST  -0.938110 seconds

All time settings (i know of) are correct. I restarted the sshd service and cron service, but log files still have the wrong timezone.

It seem to happen on many log files like messages, secure, maillog. Only log files from simple programs like bfd, rkhunter and such have the correct time.

Has anybody got an idea what might be wrong?

T. Akhayo
  • 241
  • 1
  • 2
  • 3

2 Answers2

18

As Dennis pointed out try to restart syslog service. On centos 7 I did

systemctl restart rsyslog
TroodoN-Mike
  • 281
  • 2
  • 5
1

I have found a solution. You need to download package tzdata:

yum install tzdata

and then restart asterisk, it will make logs time correct.

slm
  • 7,355
  • 16
  • 54
  • 72
Batchen
  • 11
  • 1