[OmniOS-discuss] Set locale in zone

Eric Sproul esproul at omniti.com
Wed Jan 29 15:06:22 UTC 2014


On Wed, Jan 29, 2014 at 8:37 AM, Lauri Tirkkonen <lotheac at iki.fi> wrote:
> On Wed, Jan 29 2014 12:35:26 +0100, Christian Flaig wrote:
>> I'm still on r15006, will migrate/re-install soon.
>> I've created a new zone, and can't set the locale from "C" to
>> "en_GB.UTF-8" for that zone. The global zone has this setting, but I
>> haven't found out how to configure it (in non-global zone) or where it
>> is configured (global zone).
>>
>> I've tried the following:
>> (1) /etc/default/init
>> According to several instructions on the web, this is the place where
>> I should put my locale configuration. I can define all the variables,
>> but the system doesn't take them (command "locale" still shows "C").
>
> This works for me. You probably need to restart the zone for changes to
> take effect though. Tested as follows:
>
>     # pargs -e $(pgrep -z kekkonen svc.startd)
>     5193:       /lib/svc/bin/svc.startd
>     envp[0]: _=*5088*/lib/svc/bin/svc.startd
>     envp[1]: LANG=en_US.UTF-8
>     envp[2]: LC_TIME=C
>     envp[3]: PATH=/usr/sbin:/usr/bin
>     envp[4]: PWD=/
>     envp[5]: SHLVL=1
>     envp[6]: TZ=Europe/Helsinki
>     envp[7]: A__z="*SHLVL

You should also try to test over a connection that is not ssh, such as
zlogin from the global zone.  OpenSSH clients are frequently
configured by default to send the client's environment variables to
the server (this is a feature of the SSH protocol version 2).  See the
"SendEnv" setting in your ssh_config man page.  This tripped up
another of our users recently.

Unfortunately, our ssh daemon ("SunSSH"), having been forked quite a
long time ago from OpenSSH, does not have the corresponding AcceptEnv
server-side control, which could be used prevent clients from sending
certain environment variables if you so choose, so for now you'd need
to make sure your ssh client doesn't override the server's locale
environment.

Eric


More information about the OmniOS-discuss mailing list