aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2011-10-25 12:47:26 -0400
committerBill Nottingham <notting@redhat.com>2011-10-25 12:47:26 -0400
commitd088bd27ef9fac2695c9769b4fbb230e32d93b31 (patch)
tree75b7b165f06bdef14e63cdb4f7831d948db60b17
parent05d7d8b6ee43103a589c8a999d5d96bdcd06f519 (diff)
downloadinitscripts-d088bd27ef9fac2695c9769b4fbb230e32d93b31.tar
initscripts-d088bd27ef9fac2695c9769b4fbb230e32d93b31.tar.gz
initscripts-d088bd27ef9fac2695c9769b4fbb230e32d93b31.tar.bz2
initscripts-d088bd27ef9fac2695c9769b4fbb230e32d93b31.tar.xz
initscripts-d088bd27ef9fac2695c9769b4fbb230e32d93b31.zip
If locale.conf exists, use it. (#706756, in part)
systemd's algorithm on startup is: - if /etc/locale.conf is parseable, use that - otherwise, use /etc/sysconfig/i18n Given that we have a heirarchy of system -> user settings here, simply go: ~/.i18n > /etc/locale.conf > /etc/sysconfig/i18n Add some documentation as well.
-rwxr-xr-xlang.csh2
-rwxr-xr-xlang.sh2
-rwxr-xr-xprefdm1
-rw-r--r--rc.d/init.d/functions2
-rwxr-xr-xrc.d/rc2
-rw-r--r--sysconfig.txt20
6 files changed, 20 insertions, 9 deletions
diff --git a/lang.csh b/lang.csh
index e8560b24..3a65c64b 100755
--- a/lang.csh
+++ b/lang.csh
@@ -11,7 +11,7 @@ if ($?LANG) then
setenv LANG $saved_lang
unset saved_lang
else
- foreach file (/etc/sysconfig/i18n "$HOME/.i18n")
+ foreach file (/etc/sysconfig/i18n /etc/locale.conf "$HOME/.i18n")
if ( -f $file ) then
eval `sed -ne 's|^[[:blank:]]*\([^#=]\{1,\}\)=\([^=]*\)|setenv \1 \2;|p' $file`
set sourced=1
diff --git a/lang.sh b/lang.sh
index 5be62ad8..9ad5e847 100755
--- a/lang.sh
+++ b/lang.sh
@@ -8,7 +8,7 @@ if [ -n "$LANG" ]; then
LANG="$saved_lang"
unset saved_lang
else
- for langfile in /etc/sysconfig/i18n "$HOME/.i18n" ; do
+ for langfile in /etc/sysconfig/i18n /etc/locale.conf "$HOME/.i18n" ; do
[ -f $langfile ] && . $langfile && sourced=1
done
fi
diff --git a/prefdm b/prefdm
index 425d0ffe..4ee44fc5 100755
--- a/prefdm
+++ b/prefdm
@@ -4,6 +4,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
# We need to source this so that the login screens get translated
[ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
+[ -f /etc/locale.conf ] && . /etc/locale.conf
# Run preferred X display manager
preferred=
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index e313e35b..1437b252 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -61,7 +61,7 @@ if [ -z "${CONSOLETYPE:-}" ]; then
fi
fi
-if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && [ -f /etc/sysconfig/i18n ] ; then
+if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && [ -f /etc/sysconfig/i18n -o -f /etc/locale.conf ] ; then
. /etc/profile.d/lang.sh 2>/dev/null
# avoid propagating LANGSH_SOURCED any further
unset LANGSH_SOURCED
diff --git a/rc.d/rc b/rc.d/rc
index 678bb5e5..d7b68b69 100755
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -51,7 +51,7 @@ fi
# Set language, vc settings once to avoid doing it for every init script
# through functions
-if [ -z "${NOLOCALE:-}" ] && [ -f /etc/sysconfig/i18n ] ; then
+if [ -z "${NOLOCALE:-}" ] && [ -f /etc/sysconfig/i18n -o -f /etc/locale.conf ] ; then
. /etc/profile.d/lang.sh 2>/dev/null
export LANGSH_SOURCED=1
fi
diff --git a/sysconfig.txt b/sysconfig.txt
index 002c3be8..60cc84f4 100644
--- a/sysconfig.txt
+++ b/sysconfig.txt
@@ -431,9 +431,10 @@ Generic options:
-q option is not given to sendmail if /etc/sysconfig/sendmail
exists and QUEUE is empty or undefined.
-/etc/sysconfig/i18n
- If ~/.i18n exists, it is used in addition to /etc/sysconfig/i18n and allows
- per-user customization of the locales.
+/etc/locale.conf
+
+ A configutration file for locale settings. See locale.conf(5) for
+ more details.
LANG= set locale for all categories, can be any two letter ISO
language code
@@ -451,6 +452,14 @@ Generic options:
The above variables are used in /etc/profile.d/lang.sh.
+ This data will be also be read from the legacy /etc/sysconfig/i18n
+ location, but /etc/locale.conf takes precedence.
+
+ If ~/.i18n exists, it is used in addition to /etc/locale.conf and
+ /etc/sysconfig/i18n for per-user customization of the locales.
+
+/etc/vconsole.conf:
+
SYSFONT= Console font. Fonts are found in /lib/kbd/consolefonts.
UNIMAP= Unicode font map. Most fonts have these built-in. Font maps
@@ -460,8 +469,9 @@ Generic options:
SYSFONTACM= Console map. These are applied via setfont's -m option,
and are found in /lib/kbd/consoletrans.
- The above are used by the /sbin/setsysfont command (which is run
- by rc.sysinit at boot time.) For more information, see setfont(8).
+ The above are used to set up the keyboard at boot time. For more
+ information, see vconsole.conf(5). If this file does not exist,
+ values will be read from /etc/sysconfig/i18n.
Files in /etc/sysconfig/network-scripts/
========================================