Tuesday, 4 June 2013

Systems with invalid locales

Is it valid for packages (eg. maintainer scripts) to fail if you have an
invalid locale configured? Is such a failure a bug in the package?

If it is not, and we expect systems to only work when configured locales
are valid, then how should we deal with the use case below?

In the case of server/cloud instances accessed via ssh, the user can
have a locale set that is not configured on the server.

For example, I could have LC_ALL=en_GB.UTF-8 and shell into an
EC2 instance I started using Amazon's Quick Launch Wizard. With no
userdata set, the en_GB.UTF-8 locale will not be configured.

cloud-init presents a warning in this case, but does nothing further.
I know have an invalid locale set, and various things can fail.

An example of such a failure is postgresql-9.1's postinst:

Error: The locale requested by the environment is invalid.
Error: could not create default cluster. Please create it manually with

pg_createcluster 9.1 main --start

or a similar command (see 'man pg_createcluster').

This carries through to an installation of MAAS, whose installation
expects Postgres to work.

Bugs:

* MAAS: https://launchpad.net/bugs/1134036
* Postgres: https://launchpad.net/bugs/969462

What I'd like is consensus on:

1) Is it a bug if a package fails when the user doesn't have a correctly
configure locale? If so, then we can resolve to fix all packages, and
my remaining questions are moot. But this does seem quite onerous.

If it is not a bug and packages are expected to fail if the locale isn't
configured correctly, then:

2) How do we resolve this problem for cloud instances? Options I can
think of are:

a) Something arranges to configure the user's locale automatically on
logon (awkward for security reasons?)

b) Something sets the user's locale to C (or C.UTF-8?) if the locale is
invalid.

c) Make openssh default to not passing the locale across (seems a pain
for longer lived instances, where you would want it to be carried
across).

d) Do nothing; we treat this condition as invalid and expect the user to
heed the warning and sort it out. I don't like this option; I think
Ubuntu should DTRT.

Thanks,

Robie

--
ubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel