Change ubuntu time zone time

I met this strange problem, and I tried to solve this problem all day with all the methods that I found from Google, but still nothing works.

My ubuntu timezone (10.04 LTS) is Europe / Helsinki, that’s correct (when I run the date command, the result shows the correct time). But my postfix still uses the UTC timezone, because all the time in /var/log/mail.log is 3 hours ahead of my current time.

I also copied / etc / localtime to / var / spool / postfix / etc / localtime, but nothing helps. (cp / usr / share / zoneinfo / Europe / Helsinki / var / spool / postfix / etc / localtim also do not work).

I also tried running dpkg-reconfigure tzdata, it also does not work, the system time is always correct, but only mail.log was wrong.

Can someone give me some suggestion?

* I updated the postfix every time I tried to make some changes.

+3
source share
2 answers

Copying the time zone (/ etc / localtime) to postfix chroot should do the trick, but there are a few suggestions:

  • Is the / etc / timezone file installed correctly? It should probably contain only a string Europe/Helsink. (Note that you can probably set all the time zone stuff correctly with the command sudo dpkg-reconfigure tzdata.)

  • If Postfix uses syslogd for logging, it may be what logs are written in UTC. You might want to upgrade to syslogd-ng (or similar), which supports multiple time zones .

  • , /var/spool/postfix chroot, Postfix? Postfix, , , . chroot master.cf . /etc/localtime etc, Postfix.

  • , , "" , , ( ln -s targetfilename linkfilename). file /etc/localtime ; , Postfix chroot; , /usr/share/zoneinfo/Europe/Helsinki.

+5

ubuntu, : rsyslog. :

vim /etc/sysconfig/clock 
ZONE="America/New_York"     # or your timezone, of course
systemctl restart rsyslog
#  or
/etc/init.d/rsyslog restart

.

this post

0

All Articles