Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Timezone update on Solaris 10 and 11

2,233 views
Skip to first unread message

Victor Sudakov

unread,
Oct 23, 2014, 11:55:05 AM10/23/14
to
Colleagues,

Could you please help me with patching Solaris 10 and 11 due to the
changes in Daylight Savings Time in Russia.

A link to relevant documentation is very welcome.

I'm more or less familiar with zic on FreeBSD, and I know where to
obtain the latest timezone data. But I am in the dark about Solaris
specifics, especially regarding Solaris11 where TZ is set in svc, not even
in /etc/TIMEZONE.

Thanks a lot in advance for any help.



--
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

cindy.sw...@gmail.com

unread,
Oct 23, 2014, 12:10:41 PM10/23/14
to
Hi Victor,

I think this doc should help:

http://docs.oracle.com/cd/E36784_01/html/E39134/gllkr.html#scrolltoc

Let me know if it doesn't.

Thanks, Cindy

Victor Sudakov

unread,
Oct 23, 2014, 9:25:05 PM10/23/14
to
cindy.sw...@gmail.com wrote:
> >
> > Could you please help me with patching Solaris 10 and 11 due to the
> > changes in Daylight Savings Time in Russia.
> >
> > A link to relevant documentation is very welcome.
> >
> > I'm more or less familiar with zic on FreeBSD, and I know where to
> > obtain the latest timezone data. But I am in the dark about Solaris
> > specifics, especially regarding Solaris11 where TZ is set in svc, not even
> > in /etc/TIMEZONE.
> >

> I think this doc should help:

> http://docs.oracle.com/cd/E36784_01/html/E39134/gllkr.html#scrolltoc

> Let me know if it doesn't.

Sorry, Cindy, it does not help. The link says nothing about what to do
when the timezone data itself is changed (new rules for Asia/Omsk
e.g.) and how to import updated timezone data into the system.

The updated timezone database can be downloaded e.g. from
https://www.iana.org/time-zones, compiled with zic, and then installed
into Solaris, but how?

Casper H.S. Dik

unread,
Oct 24, 2014, 3:19:18 AM10/24/14
to
Victor Sudakov <v...@mpeks.no-spam-here.tomsk.su> writes:

>The updated timezone database can be downloaded e.g. from
>https://www.iana.org/time-zones, compiled with zic, and then installed
>into Solaris, but how?

As root:

# umask 022
# zic new-zic-rules

They should be installed in the standard location.

Casper

Victor Sudakov

unread,
Oct 24, 2014, 10:40:04 AM10/24/14
to
Casper H.S. Dik wrote:

> >The updated timezone database can be downloaded e.g. from
> >https://www.iana.org/time-zones, compiled with zic, and then installed
> >into Solaris, but how?

> As root:

> # umask 022
> # zic new-zic-rules

> They should be installed in the standard location.

And then? "svcadm refresh svc:/system/environment:init" perhaps?

Casper H.S. Dik

unread,
Oct 24, 2014, 12:37:36 PM10/24/14
to
Victor Sudakov <v...@mpeks.no-spam-here.tomsk.su> writes:

>Casper H.S. Dik wrote:

>> >The updated timezone database can be downloaded e.g. from
>> >https://www.iana.org/time-zones, compiled with zic, and then installed
>> >into Solaris, but how?

>> As root:

>> # umask 022
>> # zic new-zic-rules

>> They should be installed in the standard location.

>And then? "svcadm refresh svc:/system/environment:init" perhaps?

I'd say "svcadm refresh timezone"; we then update the /system/volatile/tzsync
which would inform all users of the timezone file to re-read it when they
want to use it again.

Generally, you'd also want to set TZ to localtime and use the standard
method of "zic -l <yourtimezone>"

Setting TZ to localtime make it possible to change the timezone for all
processes without requiring a reboot.

Casper

Victor Sudakov

unread,
Oct 24, 2014, 2:10:06 PM10/24/14
to
Casper H.S. Dik wrote:

> >> >The updated timezone database can be downloaded e.g. from
> >> >https://www.iana.org/time-zones, compiled with zic, and then installed
> >> >into Solaris, but how?

> >> As root:

> >> # umask 022
> >> # zic new-zic-rules

> >> They should be installed in the standard location.

> >And then? "svcadm refresh svc:/system/environment:init" perhaps?

> I'd say "svcadm refresh timezone"; we then update the /system/volatile/tzsync
> which would inform all users of the timezone file to re-read it when they
> want to use it again.

OK, running "svcadm refresh timezone" did touch the file
/system/volatile/tzsync. I hope this works.

> Generally, you'd also want to set TZ to localtime and use the standard
> method of "zic -l <yourtimezone>"

Well,

# grep TZ /etc/TIMEZONE
TZ=localtime
# echo $TZ
localtime

> Setting TZ to localtime make it possible to change the timezone for all
> processes without requiring a reboot.

Oh, in FreeBSD the compiled default timezone has always been placed to
/etc/localtime since time immemorial, no reboot required. I'm glad
Solaris finally saw the light :)

And thank you very much for your help.

Casper H.S. Dik

unread,
Oct 24, 2014, 2:21:03 PM10/24/14
to
Victor Sudakov <v...@mpeks.no-spam-here.tomsk.su> writes:

># grep TZ /etc/TIMEZONE
>TZ=localtime
># echo $TZ
>localtime

That is, I think, the default these days.

>> Setting TZ to localtime make it possible to change the timezone for all
>> processes without requiring a reboot.

>Oh, in FreeBSD the compiled default timezone has always been placed to
>/etc/localtime since time immemorial, no reboot required. I'm glad
>Solaris finally saw the light :)

Well, in the "put everything in SMF" some sane minds believe that using
the same old command to put it in SMF are much better than using "svccfg"
(aka regedit :-) and so I was instrumental in making sure that
"zic -l TZ-of-your-choice" both creates the symlink and update the SMF
repository. I did a similar thing with domainname and hostname.

Not been to lucky with the nameservice folks.

>And thank you very much for your help.

You're welcome.

Casper

Victor Sudakov

unread,
Oct 25, 2014, 7:10:05 AM10/25/14
to
Casper H.S. Dik wrote:

> ># grep TZ /etc/TIMEZONE
> >TZ=localtime
> ># echo $TZ
> >localtime

> That is, I think, the default these days.

> >> Setting TZ to localtime make it possible to change the timezone for all
> >> processes without requiring a reboot.

> >Oh, in FreeBSD the compiled default timezone has always been placed to
> >/etc/localtime since time immemorial, no reboot required. I'm glad
> >Solaris finally saw the light :)

> Well, in the "put everything in SMF" some sane minds believe that using
> the same old command to put it in SMF are much better than using "svccfg"
> (aka regedit :-) and so I was instrumental in making sure that
> "zic -l TZ-of-your-choice" both creates the symlink and update the SMF
> repository. I did a similar thing with domainname and hostname.

Do you mean to say that "zic -l Asia/Novosibirsk" and
"svccfg timezone:default setprop timezone/localtime = astring: Asia/Novosibirsk"

are equivalent, and it is sufficient to run only one of those
commands? In other words, would "zic -l" set the timezone/localtime
svc property?

Casper H.S. Dik

unread,
Oct 25, 2014, 8:34:53 AM10/25/14
to
Victor Sudakov <v...@mpeks.no-spam-here.tomsk.su> writes:

>Do you mean to say that "zic -l Asia/Novosibirsk" and
>"svccfg timezone:default setprop timezone/localtime = astring: Asia/Novosibirsk"

>are equivalent, and it is sufficient to run only one of those
>commands? In other words, would "zic -l" set the timezone/localtime
>svc property?

Yes.:

# svccfg -s timezone:default listprop timezone/localtime
timezone/localtime astring Europe/Amsterdam

# zic -l Asia/Novosibirsk
# svccfg -s timezone:default listprop timezone/localtime
timezone/localtime astring Asia/Novosibirsk

# zic -l Europe/Amsterdam
# svccfg -s timezone:default listprop timezone/localtime
timezone/localtime astring Europe/Amsterdam

It seems that the manual page wasn't updated.

I've changed kbd(1m) which now also updates the SMF properties
(compare the Solaris 11.1 and the Solaris 11.2 manual pages)


Casper

Victor Sudakov

unread,
Oct 25, 2014, 11:05:05 AM10/25/14
to
Casper H.S. Dik wrote:

> >Do you mean to say that "zic -l Asia/Novosibirsk" and
> >"svccfg timezone:default setprop timezone/localtime = astring: Asia/Novosibirsk"

> >are equivalent, and it is sufficient to run only one of those
> >commands? In other words, would "zic -l" set the timezone/localtime
> >svc property?

> Yes.:

> # svccfg -s timezone:default listprop timezone/localtime
> timezone/localtime astring Europe/Amsterdam

> # zic -l Asia/Novosibirsk
> # svccfg -s timezone:default listprop timezone/localtime
> timezone/localtime astring Asia/Novosibirsk

> # zic -l Europe/Amsterdam
> # svccfg -s timezone:default listprop timezone/localtime
> timezone/localtime astring Europe/Amsterdam

Thanks, that's great.

Casper H.S. Dik

unread,
Oct 25, 2014, 11:11:42 AM10/25/14
to
Victor Sudakov <v...@mpeks.no-spam-here.tomsk.su> writes:

>Casper H.S. Dik wrote:

>> >Do you mean to say that "zic -l Asia/Novosibirsk" and
>> >"svccfg timezone:default setprop timezone/localtime = astring: Asia/Novosibirsk"

>> >are equivalent, and it is sufficient to run only one of those
>> >commands? In other words, would "zic -l" set the timezone/localtime
>> >svc property?

>> Yes.:

>> # svccfg -s timezone:default listprop timezone/localtime
>> timezone/localtime astring Europe/Amsterdam

>> # zic -l Asia/Novosibirsk
>> # svccfg -s timezone:default listprop timezone/localtime
>> timezone/localtime astring Asia/Novosibirsk

>> # zic -l Europe/Amsterdam
>> # svccfg -s timezone:default listprop timezone/localtime
>> timezone/localtime astring Europe/Amsterdam

>Thanks, that's great.

And I forgot to mention that it also refreshes the service so
it does it all.

Casper

Victor Sudakov

unread,
Oct 26, 2014, 12:15:05 AM10/26/14
to
It would be good to document it somewhere.

Casper H.S. Dik

unread,
Oct 26, 2014, 6:34:02 AM10/26/14
to
Victor Sudakov <v...@mpeks.no-spam-here.tomsk.su> writes:

>> And I forgot to mention that it also refreshes the service so
>> it does it all.

>It would be good to document it somewhere.

Agreed; I'll file a bug. Note that we fixed this before Solaris 11
was shipped.

I think I asked the engineer to update zic(1m) to update SMF
by itself but we failed to reflect that change in the Solaris
documentation.

Of course, it is more than just changing that manual page; there are
a number of other documents that needs to be fixed also.

SMF is useful to configure a system when it is being installed using
a manifest that allows you to specify all customizations for all
services; but requiring admins to type:

# svccfg -s svc:/system/identity:node \
"setprop config/nodename = astring: newhostname"
# svcadm refresh svc:/system/identity:node
# svcadm restart svc:/system/identity:node

is more like punishing them.

So I changed the hostname(1m) command so that the sysadmin can just
type:
hostname newhostname

Casper

Victor Sudakov

unread,
Oct 26, 2014, 12:15:04 PM10/26/14
to
Casper H.S. Dik wrote:

[dd]

> SMF is useful to configure a system when it is being installed using
> a manifest that allows you to specify all customizations for all
> services;

I politely disagree. Nothing is as useful as text configs.

In FreeBSD, for example, all customizations can be specified by
appending variable=value pairs to /etc/rc.conf.local, or by placing
snippets into /etc/rc.conf.d/

This can be done by a script, if necessary, or any kind of CLI or GUI
configurator, or manually.

> but requiring admins to type:

> # svccfg -s svc:/system/identity:node \
> "setprop config/nodename = astring: newhostname"
> # svcadm refresh svc:/system/identity:node
> # svcadm restart svc:/system/identity:node

> is more like punishing them.

I completely agree. smf is a good idea as a facility to maintain
system services up and running. But trying to reinvent Windows
registry for storing configurations looks odd at best.

I have seen in my life yet another system which tried to present its
configuration as a tree looking very much like the Windows registry. It
was the Nortel Multiservice Switch. I am so happy it's EOL. It was a
royal PITA configuring it from the CLI, I could never do it without
looking into my workbook.

> So I changed the hostname(1m) command so that the sysadmin can just
> type:
> hostname newhostname

That's great, provided the sysadmin can be sure that this command
will also make all the necessary svc actions and store the
configuration permanently. Like, I did not know that "zic -l" will
do that for me.

YTC#1

unread,
Oct 26, 2014, 2:31:04 PM10/26/14
to
On 26/10/2014 10:33, Casper H.S. Dik wrote:
> Victor Sudakov <v...@mpeks.no-spam-here.tomsk.su> writes:
>
>>> And I forgot to mention that it also refreshes the service so
>>> it does it all.
>
>> It would be good to document it somewhere.
>
> Agreed; I'll file a bug. Note that we fixed this before Solaris 11
> was shipped.
>
> I think I asked the engineer to update zic(1m) to update SMF
> by itself but we failed to reflect that change in the Solaris
> documentation.
>
> Of course, it is more than just changing that manual page; there are
> a number of other documents that needs to be fixed also.
>
> SMF is useful to configure a system when it is being installed using
> a manifest that allows you to specify all customizations for all
> services; but requiring admins to type:
>
> # svccfg -s svc:/system/identity:node \
> "setprop config/nodename = astring: newhostname"
> # svcadm refresh svc:/system/identity:node
> # svcadm restart svc:/system/identity:node
>
> is more like punishing them.

Agreed, I *hate* using svccfg to set time honoured stuff, especially
when it is then reflected on the flat text file(s) we all know an love :-)

My current favourite command is
# nscfg import -fv

So I can drive DNS configs from /etc/resolv.conf and nsswitch.conf

Except for the S11 bug where it unmounts all the NFS mounts and only
remounts ones in /etc/vfstab :-(


>
> So I changed the hostname(1m) command so that the sysadmin can just
> type:
> hostname newhostname
>
> Casper
>



--
Bruce Porter
"The internet is a huge and diverse community but mainly friendly"
http://ytc1.blogspot.co.uk/
There *is* an alternative! http://www.openoffice.org/

Casper H.S. Dik

unread,
Oct 26, 2014, 4:29:53 PM10/26/14
to
Victor Sudakov <v...@mpeks.no-spam-here.tomsk.su> writes:

>> SMF is useful to configure a system when it is being installed using
>> a manifest that allows you to specify all customizations for all
>> services;

>I politely disagree. Nothing is as useful as text configs.

I don't agree. I may have agreed at one time in my life, but I
believe it is extremely easy to get the full configuration of a system
for all of its services in one single xml file rather than having to
modify 10s of text-only configuration files.

>That's great, provided the sysadmin can be sure that this command
>will also make all the necessary svc actions and store the
>configuration permanently. Like, I did not know that "zic -l" will
>do that for me.

This time it is documented (at least for domainname, hostname [as of 11.1]
and kbd [as of 11.2])

Casper
0 new messages