In FreeBSD, I'd like to set the timezone to UTC in an unattended way. If I run tzsetup
, and select "yes" and "a" in the dialogs, for choosing UTC, I see that there are no /etc/localtime
files present.
So if I want to set up UTC on a server in an unattended way, can I just rm /etc/localtime
instead of running tzsetup
?
Removing
/etc/localtime
will default the system to UTC because there's no "local" time zone (this is what happens when you run tzsetup, as you surmised).For an automated install you simply remove the
tzsetup
bit from the bsdinstalltime
script - that script then does nothing and leaves you with an installation that expects a UTC system clock and operates in UTC.Note that if you do this you must ensure your system's hardware/BIOS clock is set to UTC - most are these days, but if yours isn't "Strange Things" can potentially happen.
If you previously configured the system with a non-UTC hardware clock for some bizarre reason you also need to fix that and then remove
/etc/wall_cmos_clock
(an empty file that serves as a flag to tell the system that the hardware clock is NOT set to UTC).Try this (or similar):
(found)
You may be able to do it as a symlink, too: