Systemd Environment NLS LANG

General support questions
Post Reply
Disdainful
Posts: 3
Joined: 2018/01/22 14:01:49

Systemd Environment NLS LANG

Post by Disdainful » 2018/01/22 14:09:50

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

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Systemd Environment NLS LANG

Post by pjsr2 » 2018/01/22 15:14:30

Add it to "DefaultEnvironment=" in the file /etc/systemd/system.conf

See:

Code: Select all

man systemd-system.conf

Disdainful
Posts: 3
Joined: 2018/01/22 14:01:49

Re: Systemd Environment NLS LANG

Post by Disdainful » 2018/01/22 15:42:17

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.

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Systemd Environment NLS LANG

Post by pjsr2 » 2018/01/22 21:43:53

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.

Disdainful
Posts: 3
Joined: 2018/01/22 14:01:49

Re: Systemd Environment NLS LANG

Post by Disdainful » 2018/01/23 07:55:24

Thank you. My Fault.
I added correctly DefaultEnvironment="NLS_LANG='CZECH_CZECH REPUBLIC.UTF8'"
Now it works

Post Reply