Receiving mail through Sendmail wrong time

For some reason when we upgraded our box our time zone got out of wack.

I did the following:

cp /usr/share/zoneinfo/America/Chicago /etc/localtime

When I enter

date

I get the following:

Code:
Thu Apr 30 10:57:12 CDT 2015

so it appears to be set correctly, but when I get mail its showing 5 hours LATER....

I'm not sure where to go from here to fix this, but any help would be appreciated.
 
Something is still wrong, I haven't quite figured out yet, but after setting the tzsetup and verifying that the hardware is set for CDT, it seems that sometime overnight the time moves itself up by 6 hours...

So as an example, I just sent myself a test message this morning where it is currently 8:27am, but the email shows a receipt time of 1:27pm.

If I go back and reset the tzsetup it will correct it, so I'm not sure if another process is changing it or if a reboot is playing havoc with me.

Suggestions?
 
Yes but it appears to be blank.

That's normal, the file is only a "flag" file for testing if a setting is on or off, from adjkerntz(8):

Code:
If the file /etc/wall_cmos_clock exists, it means
that the CMOS clock keeps local time (MS-DOS and MS-Windows compatible
mode).  If that file does not exist, it means that the CMOS clock keeps
UTC time.  The adjkerntz utility passes this state to the
machdep.wall_cmos_clock kernel variable.

This is what gets run by cron(8) every night and might be the culprit in your case, from /etc/crontab:

Code:
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time.  See adjkerntz(8) for details.
1,31    0-5     *       *       *       root    adjkerntz -a

Try running that manually during the day and see if you can replicate the problem.

I would switch to running the HW clock in UTC if that's possible, it's a much less complicated and error-prone setup anyway.
 
Yep that's in the /etc/crontab

So if I set the hw to UTC that should resolve the issue correct?

It should work both ways and I have no idea why it doesn't work for you with HW clock in local time. Set the HW clock to UTC, run tzsetup(8) again with the UTC option selected and see how it goes.

Setting the HW clock to UTC makes configuration easier because the kernel runs in UTC internally anyway. All UNIX and UNIX-like OSes prefer to have the HW clock set to UTC.
 
Reset the HW clock and restarted the server, now it seems to be reporting the time correctly.

I'll see what it does tomorrow....
 
Back
Top