Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#27269 - [initscripts 2011.11.3-1] locale.sh fails to source rc.conf

Attached to Project: Arch Linux
Opened by Shibata Ken (sbtk) - Sunday, 27 November 2011, 04:48 GMT
Last edited by Eric Belanger (Snowman) - Sunday, 27 November 2011, 09:46 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
====
In initscripts 2011.11.3-1, /etc/profile.d/locale.sh tries to
source /etc/rc.conf with this code:

export LANG=$(. /etc/rc.conf 2> /dev/null ; echo "$LOCALE")

but due to a lack of root privileges (I think), rc.conf will not sourced.
It leads unintended locale settings such as `LC_CTYPE="POSIX"'.


Additional info:
====
% pacman -Q initscripts
initscripts 2011.11.3-1

% sudo grep LOCALE /etc/rc.conf
LOCALE="en_US.utf8"
DAEMON_LOCALE="no"

% sudo grep LANG /etc/rc.conf
%

% ls -l /etc/locale.conf
ls: cannot access /etc/locale.conf: No such file or directory

% locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

% locale -a
C
POSIX
en_US
en_US.iso88591
en_US.utf8
ja_JP.utf8


To confirm:
====
1. Remove `2> /dev/null' from `export LANG=$(. /etc/rc.conf 2> /dev/null ... '
2. Logout and log in. Error message will be displayed such as
`/etc/profile.d/locale.sh:.:9: permission denied: /etc/rc.conf'
This task depends upon

Closed by  Eric Belanger (Snowman)
Sunday, 27 November 2011, 09:46 GMT
Reason for closing:  Not a bug
Comment by Karol Błażewicz (karol) - Sunday, 27 November 2011, 05:27 GMT
Works for me.
Have you tried setting LANG?
Comment by Allan McRae (Allan) - Sunday, 27 November 2011, 06:13 GMT
What are the permissions of your rc.conf file?
Comment by Shibata Ken (sbtk) - Sunday, 27 November 2011, 06:48 GMT
@Karol
Just before I tried setting LANG in /etc/locale.conf, it works.

@Allan
0600
Comment by Karol Błażewicz (karol) - Sunday, 27 November 2011, 06:54 GMT
Permissions are 0644 for me.
Comment by Shibata Ken (sbtk) - Sunday, 27 November 2011, 07:04 GMT
@Karol
Sorry, I didn't know that rc.conf should be readable for normal users.
I changed permissions from 0600 to 0644 (and rm-ed locale.conf), it also works.
Thank you guys for quick response.

Loading...