LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-25-2016, 12:23 AM   #1
me_h
LQ Newbie
 
Registered: Jul 2016
Distribution: Slackware
Posts: 19

Rep: Reputation: Disabled
$LANG per user doesn't obey the global $LANG set in /etc/profile.d/lang.sh


In Slackware 14.2, I set $LANG in /etc/profile.d/lang.sh to en_US.UTF-8. However, the per user $LANG doesn't follow the global $LANG and when I execute
Code:
echo $LANG
I get
Code:
en_US
(except when I execute it as root after su -)

I think that this problem happened after upgrading from alien's KDE 5_16.06 to 5_16.07.
any help or any clue where to start from to solve this problem is greatly appreciated.
 
Old 07-25-2016, 01:52 AM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Have you verified /etc/profile.d/lang.sh is executable by "others"?

Code:
jbhansen@craven-moorhead:~$ ls -la /etc/profile.d/lang.sh 
-rwxr-xr-x 1 root root 1197 Feb 15  2004 /etc/profile.d/lang.sh*
 
Old 07-25-2016, 02:53 AM   #3
me_h
LQ Newbie
 
Registered: Jul 2016
Distribution: Slackware
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Have you verified /etc/profile.d/lang.sh is executable by "others"?
Yes, it's fine.
Code:
bash-4.3$ ls -la /etc/profile.d/lang.sh 
-rwxr-xr-x 1 root root 1359 Jul 24 21:55 /etc/profile.d/lang.sh
 
Old 07-25-2016, 02:59 AM   #4
suppy
Member
 
Registered: Mar 2012
Location: Sweden
Distribution: Slackware
Posts: 83

Rep: Reputation: 60
when you say "per user $LANG", are you sure you don't have a ~/.bash_profile or ~/.bashrc that sets your lang to en_US?
 
Old 07-25-2016, 03:53 AM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Looking at your output, it seems you are not doing a login shell, so it doesn't process /etc/profile or anything in your /etc/profile.d/ directory.

Try running su - $your-username, type in your password and then see what the output of echo $LANG is.

If it is the correct lang, you need to change your terminal to use a login prompt or set $LANG in your .bashrc.

Last edited by bassmadrigal; 07-25-2016 at 07:08 AM. Reason: Fixed bad tags
 
2 members found this post helpful.
Old 07-25-2016, 04:18 AM   #6
me_h
LQ Newbie
 
Registered: Jul 2016
Distribution: Slackware
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
when you say "per user $LANG", are you sure you don't have a ~/.bash_profile or ~/.bashrc that sets your lang to en_US?
Yes, I have no ~/.bash_profile or ~/.bashrc .
 
Old 07-25-2016, 04:32 AM   #7
me_h
LQ Newbie
 
Registered: Jul 2016
Distribution: Slackware
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
Looking at your output, it seems you are not doing a login shell, so it doesn't process /etc/profile or anything in your /etc/profile.d/ directory.

Try running su - $your-username, type in your password and then see what the output of [b]echo $LANG[/code] is.

If it is the correct lang, you need to change your terminal to use a login prompt or set $LANG in your .bashrc.
After su - $my-username,
Code:
echo $LANG
returned the right value. So, I created a .bashrc file and set $LANG in it and since then echo $LANG returns en_US.UTF-8. But non-English characters are still not shown correctly in Dolphin and other KDE window managers.

Quote:
Looking at your output, it seems you are not doing a login shell, so it doesn't process /etc/profile or anything in your /etc/profile.d/ directory
What is preventing me from doing a login shell?

Quote:
If it is the correct lang, you need to change your terminal to use a login prompt or set $LANG in your .bashrc.
How may I change my terminal to use a login prompt?
 
Old 07-25-2016, 05:56 AM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
What terminal do you use?
 
Old 07-25-2016, 06:05 AM   #9
me_h
LQ Newbie
 
Registered: Jul 2016
Distribution: Slackware
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
What terminal do you use?
Konsole
 
Old 07-25-2016, 06:20 AM   #10
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by me_h View Post
Konsole
Konsole does not start a login shell by default. You need to configure that in the settings for your profile. The LANG setting in /etc/profile.d will not be used if you are not starting a login shell.
 
Old 07-25-2016, 06:38 AM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Unfortunately, I am at work and don't have the ability to give you the exact location, but somewhere under the settings menu there's an option to edit your profile. Go there and then find the place where it's calling /bin/bash and change it to /bin/bash -l (that's a lower case L, not an uppercase i).
 
Old 07-25-2016, 08:01 AM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
In a traditional X environment $LANG would be inherited down the process-tree from it's parents. I can't speak for KDE as I neither like nor install it, but I certainly don't need to have my xterms run a 'login shell' simply to have the value of $LANG visible. If LANG is not set in the environment of whatever is launching your applications within X then something is broken and making konsole run a login shell is simply masking the issue in one specific place and IMO focusing on that is barking up the wrong tree.

But then in these days of systemd-localed, and dbus interfaces to do everything god only knows what craziness ensues in desktops like kde that have bought into Poettering's vision, hook, line and sinker.


Sorry, can't help further as I don't have KDE available to play with... just wanted to say I don't think making it a 'login shell' is the right answer.
 
Old 07-25-2016, 08:39 AM   #13
suppy
Member
 
Registered: Mar 2012
Location: Sweden
Distribution: Slackware
Posts: 83

Rep: Reputation: 60
Are you logging in from the terminal and doing a manual startx, or are you logging in via kdm or xdm (or something else?) in runlevel 4?
 
Old 07-25-2016, 08:58 AM   #14
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by suppy View Post
Are you logging in from the terminal and doing a manual startx, or are you logging in via kdm or xdm (or something else?) in runlevel 4?
With konsole, I don't think it matters. I never had it inherit anything from my normal shells whether I was runlevel 3 or 4. My PS1 was never user@computer (I think it just said bash-4.3 $).
 
Old 07-25-2016, 09:07 AM   #15
suppy
Member
 
Registered: Mar 2012
Location: Sweden
Distribution: Slackware
Posts: 83

Rep: Reputation: 60
Quote:
Originally Posted by bassmadrigal View Post
With konsole, I don't think it matters. I never had it inherit anything from my normal shells whether I was runlevel 3 or 4. My PS1 was never user@computer (I think it just said bash-4.3 $).
One of his complaints was that Dolphin (which he presumably runs right from inside KDE, not bothering to start a terminal emulator to (re)load his profile and then manually typing 'dolphin' on the commandline) has the wrong LANG setting. That will be inherited from his X Windows session, so finding out how he starts his X Windows is relevant.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 13.37 doesn't consider setting of LANG in /etc/profile.d/lang.sh after 'su' Didier Spaier Slackware 5 12-14-2013 02:24 PM
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature canonas Linux - Software 3 06-16-2008 04:00 AM
why do settings in /etc/profile.d/lang.sh get overridden? echowarpt Slackware 3 02-19-2007 08:13 PM
What is the use of lang in <head lang=''> tooparam Programming 2 02-01-2006 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration