[Pkg-postgresql-public] Bug#791526: Bug#791526: Bug#791526: Bug#791526: postgresql-9.4: postgresql needs locales-all to create cluster on install

Christoph Berg myon at debian.org
Fri Sep 4 12:16:12 UTC 2015


Re: Malte 2015-09-03 <2209952.WRhyhFcPHE at localhost>
> first off: unsetting LC_ALL ("unset LC_ALL") seems to have created a 
> disturbance in the force and de_DE.UTF-8 slipped in the locale settings. WTF? 
> The only thing that I ever tell my servers about german is the keyboard 
> layout...

If you log in via ssh, the client system will also forward some locale
settings to the server, so it's possibly not the remote system's fault
when things fall over.

> # locale
> locale: Cannot set LC_ALL to default locale: No such file or directory
> LANG=en_US.UTF-8
> LANGUAGE=
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC=de_DE.UTF-8
> LC_TIME=de_DE.UTF-8
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY=de_DE.UTF-8
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER=de_DE.UTF-8
> LC_NAME=de_DE.UTF-8
> LC_ADDRESS=de_DE.UTF-8
> LC_TELEPHONE=de_DE.UTF-8
> LC_MEASUREMENT=de_DE.UTF-8
> LC_IDENTIFICATION=de_DE.UTF-8
> LC_ALL=

All the above values that do not have any "quotes" are explicitly set
in your environment, that is LC_NUMERIC LC_TIME LC_MONETARY LC_PAPER
LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION. On
top of that you have LANG=en_US.UTF-8 set; LC_ALL used to paper over
all of these.

I've found the bug: what's happening here is that the postgresql
server postinst script tries to clean up the environment and then
import the system locale before creating the initial cluster using
pg_createcluster. But the list of environment variables purged was
incomplete, some of the above values stayed around, and then
setlocale() failed because LC_IDENTIFICATION and others were invalid.
We'll include a fix for this in the next upload.

diff --git a/debian/maintscripts-functions b/debian/maintscripts-functions
index 8693cbd..e02571a 100644
--- a/debian/maintscripts-functions
+++ b/debian/maintscripts-functions
@@ -52,7 +52,7 @@ _remove_tsearch() {
 # predictable.  /etc/default/locale overrides /etc/environment. Note that
 # /etc/environment is not a shell script, so we must be careful with parsing.
 set_system_locale() {
-    loc_vars="LC_COLLATE LC_CTYPE LC_MONETARY LC_MESSAGES LC_NUMERIC LC_TIME LC_ALL LANG LANGUAGE"
+    loc_vars="LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL"
     unset $loc_vars
     for v in $loc_vars; do
         unset val

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-postgresql-public/attachments/20150904/a4125271/attachment.sig>


More information about the Pkg-postgresql-public mailing list