FreeBSD: Testing/Applying Daylight Saving Time (DST) Patch

Testing if my current system is ready for DST (March 11, 2007)

swinful@thinkpad> uname -a
FreeBSD thinkpad.goldcost.com 6.2-STABLE FreeBSD 6.2-STABLE #3: Fri Mar 2 00:37:54 EST 2007 root@thinkpad.goldcost.com:/usr/obj/usr/src/sys/T43P i386

After 1:59AM the time should display 3:00AM and not 2:00AM

sh$ sudo date 0703110159.57;while [ 1 ]; do date; sleep 1; done
Sun Mar 11 01:59:57 EST 2007
Sun Mar 11 01:59:58 EST 2007
Sun Mar 11 01:59:59 EST 2007
Sun Mar 11 02:00:00 EST 2007
Sun Mar 11 02:00:01 EST 2007

Looks like my system is not yet patched. I recently built a “new world and kernel”.
This post suggested /usr/ports/misc/zoneinfo be installed. Please note: Before installing zoneinfo that files in /usr/share/zoneinfo will be overwritten.

swinful@thinkpad> pkg_info | grep zone
swinful@thinkpad>
—> Installing ‘zoneinfo-2007.c’ from a port (misc/zoneinfo)
—> Building ‘/usr/ports/misc/zoneinfo’
===> Cleaning for zoneinfo-2007.c
===> Vulnerability check disabled, database not found
=> tzdata2007c.tar.gz doesn’t seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://elsie.nci.nih.gov/pub/.
tzdata2007c.tar.gz 100% of 154 kB 293 kBps
…edited…
===> Registering installation for zoneinfo-2007.c
===> Cleaning for zoneinfo-2007.c

Now what? Is there more to it? Let’s see:

sh$ sudo date 0703110159.57;while [ 1 ]; do date; sleep 1; done
Sun Mar 11 01:59:57 EST 2007
Sun Mar 11 01:59:58 EST 2007
Sun Mar 11 01:59:59 EST 2007
Sun Mar 11 02:00:00 EST 2007
Sun Mar 11 02:00:01 EST 2007

Yes, there is more to it than just installing zoneinfo or building a new kernel or “new world”. The post also suggested running tzsetup. After running this setup, I then received the expected output, without having to reboot my system.

swinful@thinkpad> sudo tzsetup

Follow the prompt then test the time once again.

$ sudo date 0703110159.57;while [ 1 ]; do date; sleep 1; done
Sun Mar 11 01:59:57 EST 2007
Sun Mar 11 01:59:57 EST 2007
Sun Mar 11 01:59:58 EST 2007
Sun Mar 11 01:59:59 EST 2007
Sun Mar 11 03:00:00 EDT 2007
Sun Mar 11 03:00:01 EDT 2007

Looks good to me. Don’t forget to set the time back once done testing.

 sudo ntpdate pool.ntp.org
4 Mar 18:33:52 ntpdate[41151]: step time server 80.51.167.97 offset -545435.585141 sec

Advertisements
This entry was posted in *Nix. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s