Solaris 11 - Changing systems default locale


 
Thread Tools Search this Thread
Operating Systems Solaris Solaris 11 - Changing systems default locale
# 1  
Old 11-30-2017
Solaris 11 - Changing systems default locale

Different in Solaris 10 in that you don't just edit TIMEZONE file. LANG is currently set to en_US.UTF-8 and want it to be C.

Heres what I did:-
Code:
# svccfg -s svc:/system/environment:init setprop environment/LANG = astring: C
# svcadm refresh svc:/system/environment

And afterwards these are the results I got:-
Code:
# svccfg -s svc:/system/environment:init listprop environment/LANG
environment/LANG astring     C

Code:
# echo $LANG
en_US.UTF-8

?????

Code:
# cat /etc/TIMEZONE
#__GENERATED__V1__
#
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This file is /etc/default/init.  /etc/TIMEZONE is a symlink to this
# file.
#
# READERS OF THIS FILE: This file is Obsolete.  Migrate to reading
# properties from svc:/system/environment:init.  This file may be
# removed in future releases.
#
# WRITERS OF THIS FILE: This file is no longer user editable.  To
# effect changes to the configuration contained in this file, an
# administrator with the "System Administrator" or "System
# Configuration" Rights Profile may set the corresponding
# properties of the svc:/system/environment:init service
# instance and refresh the instance.
# See init(1M) for further details.
#
# WARNING: CHANGES TO THIS FILE WILL BE OVERWRITTEN BY THE SYSTEM.
#
CMASK=022
TZ=localtime
LANG=C

So its updated file....

Why on earth is echo $LANG still reporting wrong locale? Surely I dont need to reboot server?
# 2  
Old 11-30-2017
Try this:
Code:
$ unset LANG
$ unset LC_ALL
$ locale

I wouldn't think that you need to reboot, but you may need to reset the environment variables that define your locale. The above will show you if that is the case. If you only have a couple of terminals open you may be able to do this manually, otherwise you may need to log out and in again.

Andrew
# 3  
Old 11-30-2017
Quote:
Originally Posted by apmcd47
Try this:
Code:
$ unset LANG
$ unset LC_ALL
$ locale

I wouldn't think that you need to reboot, but you may need to reset the environment variables that define your locale. The above will show you if that is the case. If you only have a couple of terminals open you may be able to do this manually, otherwise you may need to log out and in again.

Andrew
Its Solaris 11 you can't do it this way anymore. Have to use svccfg.

I rebooted the server and it worked fine but documentation seems to imply that you don't need to do this any more.
# 4  
Old 11-30-2017
You are confusing global settings and process settings.

Changing the system locale isn't going to magically change the one currently set in your shell environment. No supported method allows to set a environment variable from the outside. Your shell was rightly keeping the LANG variable value that was set in the first place, before the svccfg.
This User Gave Thanks to jlliagre For This Post:
# 5  
Old 12-01-2017
Why change those files in such manner for entire system ?

You need a certain locale for your application / database ?
Create a user to run app / db and change locale for that user, not system wide.

Hope that helps
Regards
Peasant.
These 2 Users Gave Thanks to Peasant For This Post:
# 6  
Old 12-01-2017
Quote:
Originally Posted by psychocandy
Its Solaris 11 you can't do it this way anymore. Have to use svccfg.

I rebooted the server and it worked fine but documentation seems to imply that you don't need to do this any more.
Did you actually try my suggestion? I suspect that you didn't; I know that if you had you would have seen the new default locale.

Andrew
# 7  
Old 12-05-2017
All working now after using svccfg and rebooting server.

Locale was wrong and needed changing for entire system.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to set the japanese locale in Solaris 10

Pls help me to set the japanese locale in Solaris 10. I have checked JP locale has been already installed on Solaris BOX. Thanks, Karan N (2 Replies)
Discussion started by: nirka01
2 Replies

2. Solaris

Solaris 8: root can't ssh to other systems.

Hi, The issue is that root can not ssh to a Solaris 8 server: Please help. Thank you in advance! (7 Replies)
Discussion started by: aixlover
7 Replies

3. Solaris

Solaris "System locale" during installation

Hi I install Solaris10 and during this process there is a question "Select the initial locale to be used after the system has been installed " There is plenty of choices and default already selected is POSIX C (C). What should I choose in this list ? Why instalator asks for this question... (0 Replies)
Discussion started by: presul
0 Replies

4. Solaris

Install Locale in Solaris 9

Hi, I want to install en_US.UTF-8 locale on a solaris 9 system, can anyone please tell me how? (command and which CD to use) ---------- Post updated at 09:47 AM ---------- Previous update was at 08:56 AM ---------- Got it,.. 3. How do I add a locale after installing the Base Product? (3 Replies)
Discussion started by: Mack1982
3 Replies

5. Solaris

change default Locale

i have a new solaris 10 enviroment and when i create new users and when i go to login using the default .profile and run locale i get the following LANG= LC_CTYPE=en_IE.ISO8859-15 LC_NUMERIC=en_IE.ISO8859-15 LC_TIME=en_IE.ISO8859-15 LC_COLLATE=en_IE.ISO8859-15... (2 Replies)
Discussion started by: dshakey
2 Replies

6. Solaris

I can't set locale in Solaris 8

Hi gentlemen. I would change LANG=C to iso_8859_5. I have tried some variante, but it doesn't work. Thanks. (24 Replies)
Discussion started by: wolfgang
24 Replies

7. Solaris

Problem in locale installation through solaris 10 cds

Dear All I am in a problem where i have to install en_us locale through solaris 10 05/08 which is in 5 cds as I download from internet. when I use the following command after putting disk 1 of solaris 10 loceladm -a en_us -d /cdrom/cdrom0/s0/Solaris_10/Product It install few packages but... (3 Replies)
Discussion started by: girish.batra
3 Replies

8. Solaris

Do I need to reboot Solaris 10 server for changes in /etc/systems ?

Hi, I have upgraded my Solaris 10 2005 to Solaris 10 2007. I am facing one bug, id: 6550904. To override this issue I have done following changes in /etc/systems: set max_uheap_lpsize = 0x2000 set max_ustack_lpsize = 0x2000 set max_privmap_lpsize = 0x2000 set max_shm_lpsize =... (6 Replies)
Discussion started by: neel.gurjar
6 Replies

9. Solaris

en_GB.UTF-8 locale - which Solaris package?

Hi, I need to locate the Solaris package that installs the en_GB.UTF-8 package in /usr/lib/locale. Can anyone tell me which package it is? I have installed all the locale related packages i can see from the Solrais 8 media but none contain the required locale. My problem is that i can... (1 Reply)
Discussion started by: kitzel
1 Replies

10. UNIX for Dummies Questions & Answers

Solaris 8 locale setting

Hello does anybody know how to change the LC_TIME locale on solaris 8 to dd/mm/YYYY currently it is set to. #locale -ck LC_TIME d_fmt="%m/%d/%y" Thanks (1 Reply)
Discussion started by: thangorn
1 Replies
Login or Register to Ask a Question