Page 1 of 1

Systemd Environment NLS LANG

Posted: 2018/01/22 14:09:50
by Disdainful
Hello
I'm trying set NLS_LANG for Enviroment in Centos 7. I use this command: systemctl set-environment NLS_LANG = 'CZECH_CZECH REPUBLIC.UTF8'
It works but after the reboot system this settings is gone. How can I configure this permanently?
Thank you

Re: Systemd Environment NLS LANG

Posted: 2018/01/22 15:14:30
by pjsr2
Add it to "DefaultEnvironment=" in the file /etc/systemd/system.conf

See:

Code: Select all

man systemd-system.conf

Re: Systemd Environment NLS LANG

Posted: 2018/01/22 15:42:17
by Disdainful
OK I tryed add this into /etc/systemd/system.conf
DefaultEnvironment=NLS_LANG = 'CZECH_CZECH REPUBLIC.UTF8'
Nothing happened.

So I solved problem that I put systemctl command into startup scrypt: /etc/rc.d/rc.local and it works.

Re: Systemd Environment NLS LANG

Posted: 2018/01/22 21:43:53
by pjsr2
According to man systemd-system.conf, the syntax is:

Code: Select all

DefaultEnvironment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"
You appear to have the quotes in different positions.

Re: Systemd Environment NLS LANG

Posted: 2018/01/23 07:55:24
by Disdainful
Thank you. My Fault.
I added correctly DefaultEnvironment="NLS_LANG='CZECH_CZECH REPUBLIC.UTF8'"
Now it works