Re: default locales

2008-11-18 Diskussionsfäden Jens Rosenboom
On Tue, Nov 18, 2008 at 04:18:37PM -0500, Ryan Steele wrote:
> Michael Tautschnig wrote:
> >Hi Ryan,
> >
> >[...]
> >  
> >>>I think the answer should be pretty simple: put a comma between the 
> >>>different
> >>>locales, like
> >>>
> >>>locales locales/locales_to_be_generated multiselect en_US.UTF-8, UTF-8
> >>>  
> >>>  
> >>The non-comma version was copied directly from the fai-doc simple  
> >>examples.  If that's a typo, it's incorrect in the fai-doc package.
> >>
> >>
> >>>That should probably solve the problem.
> >>>
> >>>  
> >>>  
> >>Haven't had a chance to test this yet.
> >>
> >>
> >
> >Did you already find the time to further investigate this?
> >
> >Thanks,
> >Michael
> >
> >  
> Not yet, but I will this week, and can report back at that time.

For me the version without comma is correct, as it specifies two parts
of the locale. If you want to enable multiple locales, you can simply
use multiple lines:

locales locales/locales_to_be_generated multiselect de_DE.UTF-8 UTF-8
locales locales/locales_to_be_generated multiselect [EMAIL PROTECTED] 
ISO-8859-15
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8

giving

# cat /etc/locale.gen |grep -v '^#'
de_DE.UTF-8 UTF-8
[EMAIL PROTECTED] ISO-8859-15
en_US.UTF-8 UTF-8

on the installed client. I did have to add the package "locales" to the
FAIBASE package config however, it didn't get installed by default.


signature.asc
Description: Digital signature


Re: default locales

2008-11-18 Diskussionsfäden Ryan Steele

Michael Tautschnig wrote:

Hi Ryan,

[...]
  

I think the answer should be pretty simple: put a comma between the different
locales, like

locales locales/locales_to_be_generated multiselect en_US.UTF-8, UTF-8
  
  
The non-comma version was copied directly from the fai-doc simple  
examples.  If that's a typo, it's incorrect in the fai-doc package.




That should probably solve the problem.

  
  

Haven't had a chance to test this yet.




Did you already find the time to further investigate this?

Thanks,
Michael

  

Not yet, but I will this week, and can report back at that time.

Regards,
Ryan


Re: default locales

2008-11-18 Diskussionsfäden Michael Tautschnig
Hi Ryan,

[...]
>>
>> I think the answer should be pretty simple: put a comma between the different
>> locales, like
>>
>> locales locales/locales_to_be_generated multiselect en_US.UTF-8, UTF-8
>>   
>
> The non-comma version was copied directly from the fai-doc simple  
> examples.  If that's a typo, it's incorrect in the fai-doc package.
>
>> That should probably solve the problem.
>>
>>   
>
> Haven't had a chance to test this yet.
>

Did you already find the time to further investigate this?

Thanks,
Michael



pgpXYTeMCK3hF.pgp
Description: PGP signature


Re: default locales

2008-11-14 Diskussionsfäden Ryan Steele

Michael Tautschnig wrote:
As a preface, I'm using 3.2.14 on Ubuntu Server. 

I've got FAI install clients that install packages (for example,  
postgresql-8.3) that are dependent on the default locale being set to  
(in my case) en_US.UTF-8.  So, naturally I made sure that my  
/srv/fai/config/debconf/CLASSNAME had the following:


locales locales/default_environment_locale select en_US.UTF-8
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8



[...]

I think the answer should be pretty simple: put a comma between the different
locales, like

locales locales/locales_to_be_generated multiselect en_US.UTF-8, UTF-8
  


The non-comma version was copied directly from the fai-doc simple 
examples.  If that's a typo, it's incorrect in the fai-doc package.



That should probably solve the problem.

  


Haven't had a chance to test this yet.

Regards,
Ryan


Re: default locales

2008-11-13 Diskussionsfäden Michael Tautschnig
> As a preface, I'm using 3.2.14 on Ubuntu Server. 
>
> I've got FAI install clients that install packages (for example,  
> postgresql-8.3) that are dependent on the default locale being set to  
> (in my case) en_US.UTF-8.  So, naturally I made sure that my  
> /srv/fai/config/debconf/CLASSNAME had the following:
>
> locales locales/default_environment_locale select en_US.UTF-8
> locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8
>
[...]

I think the answer should be pretty simple: put a comma between the different
locales, like

locales locales/locales_to_be_generated multiselect en_US.UTF-8, UTF-8

That should probably solve the problem.

>
> But even if it does, I really think that FAI should check to make sure  
> the client really has the debconf information we're told we can set in  
> the $FAI_CONFIGDIR/debconf/ directory.  Based on the log entries (or  
> lack thereof), I initially assumed nothing went wrong when setting up  
> the client's locales, which is not the case, and wasted time looking  
> elsewhere for problems.
>

There is no way to check anything in this case, basically because nothing was
wrong in the sense of debconf. You can load arbitrary answers into the database,
and debconf will happily accept the data, as long as it is properly formatted.
This data was properly formatted (debconf just assumed "en_US.UTF-8 UTF-8" to be
a single value).

Best,
Michael



pgpwcizGXoATK.pgp
Description: PGP signature


Re: default locales

2008-11-13 Diskussionsfäden Ryan Steele

Thomas Lange wrote:
On Wed, 12 Nov 2008 19:20:22 -0500, Ryan Steele <[EMAIL PROTECTED]> said:
>> But even if it does, I really think that FAI should check to 
make sure
>> the client really has the debconf information we're told we can 
set in
>> the $FAI_CONFIGDIR/debconf/ directory.  Based on the log entries 
(or
>> lack thereof), I initially assumed nothing went wrong when 
setting up
>> the client's locales, which is not the case, and wasted time 
looking

>> elsewhere for problems.
> It didn't get what the right solution would be?

I'm not sure what you mean by this.  Isn't $FAI_CONFIGDIR/debconf/ the 
place we're supposed to specify debconf locale info for the client?  Or 
does that assume that the locales exist?


>If there's a pacakge
> that needs to be installed before others, we can do this in a hook.
> If you need to set additional variables, thsi can also be done in a
> hook with suffix .source.

Yeah, that was my plan to circumvent the problem.



Regards,
Ryan


Re: default locales

2008-11-13 Diskussionsfäden Thomas Lange
> On Wed, 12 Nov 2008 19:20:22 -0500, Ryan Steele <[EMAIL PROTECTED]> said:

> But even if it does, I really think that FAI should check to make sure 
> the client really has the debconf information we're told we can set in 
> the $FAI_CONFIGDIR/debconf/ directory.  Based on the log entries (or 
> lack thereof), I initially assumed nothing went wrong when setting up 
> the client's locales, which is not the case, and wasted time looking 
> elsewhere for problems.
It didn't get what the right solution would be? If there's a pacakge
that needs to be installed before others, we can do this in a hook.
If you need to set additional variables, thsi can also be done in a
hook with suffix .source.

-- 
regards Thomas


default locales

2008-11-12 Diskussionsfäden Ryan Steele
As a preface, I'm using 3.2.14 on Ubuntu Server. 

I've got FAI install clients that install packages (for example, 
postgresql-8.3) that are dependent on the default locale being set to 
(in my case) en_US.UTF-8.  So, naturally I made sure that my 
/srv/fai/config/debconf/CLASSNAME had the following:


locales locales/default_environment_locale select en_US.UTF-8
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8

But I noticed that the clients didn't think that was the default locale; 
SQL_ASCII encoding is a direct result of the default locale not being 
set and falling back to 'C'.  The evidence is pretty clear:


[EMAIL PROTECTED] chroot /target
host[~]# su - postgres -c "psql -l"
 List of databases
Name |   Owner   | Encoding 
--+---+---

postgres | postgres  | SQL_ASCII
template0| postgres  | SQL_ASCII
template1| postgres  | SQL_ASCII


After some further investigation after ctrl+c'ing to hold off on the 
reboot, I noticed that if I didn't include the 'language-pack-en' 
package in my client's package list, a 'locale -a' shows only:


C
POSIX

and the system would spew messages like:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
   LANGUAGE = (unset),
   LC_ALL = (unset),
   LANG = "en_US.UTF-8"
   are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_MESSAGES to default locale: No such file or directory

locale: Cannot set LC_ALL to default locale: No such file or directory



But, FAI (task_debconf, in particular) really seemed to want to convince 
me that everything was okay.  There was nothing in the error.log, and 
only this in the other logs:


# From fai.log
Calling task_debconf
Adding debconf data from /var/lib/fai/config/debconf/CLASSNAME
Reconfiguring package locales

# From debconf.log
info: Trying to set 'locales/default_environment_locale' [select] to 
'en_US.UTF-8'

info: Loading answer for 'locales/default_environment_locale'
info: Trying to set 'locales/locales_to_be_generated' [multiselect] to 
'en_US.UTF-8 UTF-8'

info: Loading answer for 'locales/locales_to_be_generated'


However, the results don't lie - the postgres-8.3 package thinks that 
the locale is C (or at least was at the time postgres was installed).  
So what gives?  Well, I think (not 100% sure, but definitely pretty 
suspicious) the reason is that minimal Ubuntu Server installs don't do 
any localization, and only natively have the C and POSIX locales, which 
is maybe only a nuisance in some cases, but obviously a big problem for 
packages like postgresql.  So, I suppose my only recourse here is to 
configure the locales in a hook before the package installation.  The 
instsoft.CLASSNAME hook seems like it would be a good candidate, though 
I haven't tested it yet (but will report back once I have).


But even if it does, I really think that FAI should check to make sure 
the client really has the debconf information we're told we can set in 
the $FAI_CONFIGDIR/debconf/ directory.  Based on the log entries (or 
lack thereof), I initially assumed nothing went wrong when setting up 
the client's locales, which is not the case, and wasted time looking 
elsewhere for problems.