0

We're testing FreeBSD 9.3, where I had the system configured to use America/Los_Angeles as the timezone, and we've got the ntp server pointed at pool.ntp.org. Everything was fine, until I noticed that timestamps were off in some system logs, i.e. they were reporting UTC timestamps for the log entries, instead of local time as they had been reporting previously.

So I went to the console, and sure enough, date now reports UTC:

# date Thu Jan 15 19:40:22 UTC 2015  <<-- this had been reporting PST

However, the rc.conf setting is still there for America/Los_Angeles:

# grep 'timezone' /etc/rc.conf
timezone="America/Los_Angeles"

The PostgreSQL database seems fine:

phlog=# show timezone;
      TimeZone
---------------------
 America/Los_Angeles
(1 row)

phlog=# select now();
              now
-------------------------------
 2015-01-15 11:43:44.485139-08
(1 row)

Here's our ntp.conf file:

# cat /etc/ntp.conf
server pool.ntp.org
restrict default noquery nomodify notrap nopeer
restrict 127.0.0.1

I've scanned files in /var/log/ for any clue as to what might have caused the system time to change.

# grep ntp messages
Jan 13 23:04:47 test99 ntpd[2702]: ntpd exiting on signal 15
Jan 13 23:07:07 test99 ntpd[2724]: ntpd 4.2.4p5-a (1)
Jan 13 23:58:40 test99 ntpd[2726]: time reset +0.156664 s
Jan 15 19:32:48 test99 ntpd[2726]: ntpd exiting on signal 15
Jan 15 19:34:48 test99 ntpd[2724]: ntpd 4.2.4p5-a (1)
Jan 15 19:56:12 test99 ntpd[2726]: ntpd exiting on signal 15  <<-- SEE NOTE BELOW
Jan 15 12:58:13 test99 ntpd[2725]: ntpd 4.2.4p5-a (1)

NOTE: this was the reboot after setting the timezone to America/Boise to see if it would take, it did. Now date reports:

Thu Jan 15 15:09:39 MST 2015

What might have happened to cause the system clock to lose its timezone setting?

UPDATE

I've been reading various resources related to FreeBSD timezone configuration, and found that there should be an /etc/localtime file in place. I had looked for this file, and did NOT see it when date reported UTC. After resetting things to a different timezone, I now see that file. It appears something may have deleted that file. I'll keep digging.

1

I confirmed that deleting the file /etc/localtime causes the symptoms described.

I don't know what's deleting that file in our environment, and that's very likely to be some errant logic in our code base.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.