3

The SmartOS Global Zone defaults to the UTC timezone. I'd like to schedule some cron jobs, and I'd like them to automatically follow daylight saving time changes, without requiring me to manually change the UTC offset every time the daylight saving change occurs.

How can I change the timezone for my SmartOS Global Zone?

smokris
  • 685
  • 3
  • 13
  • 27

1 Answers1

3

There are two methods to do this. The first is to write a custom SMF manifest and place it in /opt/custom/smf - any manifests in this directory are imported automatically at boot.

The other method is to use pkgin to install the smtools package. This provides a script called sm-set-timezone.

See this blog entry by Jonathan Perkin, who works for Joyent for reference.

James O'Gorman
  • 5,249
  • 2
  • 23
  • 28
  • Hmm, on the Global Zone, `sm-set-timezone` doesn't seem to persist between reboots. I'll try the SMF route. Thanks. – smokris Dec 31 '12 at 23:07
  • 1
    This doesn't work in Global Zone ````[root@44-8a-5b-9c-a1-01 ~]# date August 16, 2016 09:54:23 PM UTC [root@44-8a-5b-9c-a1-01 ~]# sm-set-timezone "Europe/Berlin" * Setting timezone for global.. * Changed to timezone to Europe/Berlin. You will need to reboot. [root@44-8a-5b-9c-a1-01 ~]# date August 16, 2016 09:54:33 PM UTC ```` – XakRu Aug 16 '16 at 21:56
  • Unfortunately it seems `smtools` package is not offered anymore via `pkgin` in GZ. – gsl Aug 17 '20 at 05:58