[SRU] ubuntu-vm-builder should set up a locale, timezone, etc

Bug #221231 reported by Neal McBurnett
6
Affects Status Importance Assigned to Milestone
ubuntu-vm-builder (Ubuntu)
Fix Released
Low
Unassigned
Hardy
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: ubuntu-vm-builder

By default ubuntu-vm-builder (e.g. in hardy) doesn't set up a locale other than "C". When I log in to the virtual machine via ssh, LANG=en_US.UTF-8 is picked up from my environment on the host. Installing things from within the vm like postgresql then leads to problems like this:

Setting up postgresql-8.3 (8.3.1-1) ...
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").
Error: The locale requested by the environment is invalid.
Error: could not create default cluster. Please create it manually with

  pg_createcluster 8.3 main --start

ubuntu-vm-builder should set up the proper locale, as well as a preferred timezone and any other similar settings that users are used to from the standard ubuntu installation methods. Defaults could be set based on the build environment, with options to override them.

Revision history for this message
Nick Barcet (nijaba) wrote :

I've pushed a branch to fix this and put a version in my ppa (https://launchpad.net/~nijaba/+archive).
Could you please give it a shot and tell us if it fixes your issue?

Revision history for this message
Neal McBurnett (nealmcb) wrote : Re: [Bug 221231] Re: ubuntu-vm-builder should set up a locale, timezone, etc

On Fri, Apr 25, 2008 at 12:33:08PM -0000, Nick Barcet wrote:
> I've pushed a branch to fix this and put a version in my ppa (https://launchpad.net/~nijaba/+archive).

Thanks. Looks cool!

 https://code.edge.launchpad.net/~nijaba/ubuntu-jeos/copy_settings

Except that I'm guessing that the line to set LANG=C at the top needs
to go now, or at least the original LANG needs to be saved for the

 chroot root locale-gen $LANG

But having different things built with different locales may be a
problem. Also note the todo comment about locales above that was
fixed long ago, though this would be a different fix.

I hacked a bit with moving the do_copy_settings to above
do_network_setup which removes most of the PERL locale complaints
without setting LANG=C, but not all of them. Perhaps better to see if
you had thoughts on this before I blindly hack any more, since I
really haven't looked at what is going on behind the scenes enough....

Revision history for this message
Nick Barcet (nijaba) wrote : Re: [Bug 221231] Re: ubuntu-vm-builder should set up a locale, timezone, etc

Neal McBurnett wrote:
> Except that I'm guessing that the line to set LANG=C at the top needs
> to go now, or at least the original LANG needs to be saved for the

Thanks for spotting this Neal. I fixed that in my branch.

> I hacked a bit with moving the do_copy_settings to above
> do_network_setup which removes most of the PERL locale complaints
> without setting LANG=C, but not all of them. Perhaps better to see if
> you had thoughts on this before I blindly hack any more, since I
> really haven't looked at what is going on behind the scenes enough....

I'm not 100% sure of it myself but I would tend to think this is one of
the last operation we want to do on the vm we are building, hence the
place where I called it. So for now I am saving the current locale
before it set to C. I hope Soren would have a more authoritative answer
on that.

Neal McBurnett (nealmcb)
Changed in ubuntu-vm-builder:
status: New → In Progress
Nick Barcet (nijaba)
Changed in ubuntu-vm-builder:
status: In Progress → Fix Committed
importance: Undecided → Low
Revision history for this message
Nick Barcet (nijaba) wrote : Re: ubuntu-vm-builder should set up a locale, timezone, etc
Nick Barcet (nijaba)
Changed in ubuntu-vm-builder:
milestone: none → ubuntu-8.04.1
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-vm-builder - 0.6

---------------
ubuntu-vm-builder (0.6) intrepid; urgency=low

  * Release into Ubuntu proper.

ubuntu-vm-builder (0.5ubuntu1~ppa4) intrepid; urgency=low

  [Loic Minier]
  * Call sh -c "$EXEC_SCRIPT" instead of "$EXEC_SCRIPT"; allows to pass
    arguments to the script; also remove check that EXEC_SCRIPT exists.

  [Nick Barcet]
  * Adding an error handler to fix LP: #217950
  * Lots of sanitization to allow for error handler
  * Add an interrupt handler to cleanup if user interrupts script
  * Stop on error in user script to fix LP: #228675
  * --ssh-key adds key to root and --ssh-user-key adds key to user
  * Added --raw option to install on raw devices/files.
    WARNING: the variables used in template files for disk definition have been
    modified. Please insure that locally created templates are updated to
    reflect this change.
  * Add --firstboot and --firstlogin options
  * First login always execute "sudo dpkg-reconfigure console-setup" so
    that the local keyboard setting is taken into account.
  * Adding the --iso parameter to create image from an iso. This requires
    suite and kernel-flavour parameters to match what is available on the iso,
    obviously.
  * Include hostname in default destination directory if defined
  * Do not use a tmpfs by default anymore
  * Place the working directory in the same directory as dest if using --tmp -
  * Added --tmpfs option to specify usage of a tmpfs for the working directory
  * VM specific parameters do not need to be the last ones anymore
  * Unknown parameters now return an error and prints usage
  * Added --overwrite for overwriting of destination directory and libvirt
    domain
  * Added ~/.ubuntu-vm-builder config handling
  * Man page improvements and reorganization

  [Soren Hansen]
  * Fix for LP: #234062 ssh root login broken

ubuntu-vm-builder (0.4ubuntu2~ppa7) hardy; urgency=low

  [ Michael Vogt ]
  * patch the way do_avoid_starting_daemons() to write a policy-rc.d file in
    the same way as pbuilder does (LP: #228372)

  [ Nick Barcet ]
  * Lock the root account by default (LP: #230291)
  * Add ssh keys to the user account and not to root (LP: #230291)
  * Added function do_copy_settings to fix bug LP: #221231
  * Fix missing ipv6 entries in host file (LP: #230299)
  * Fix issue with template arguments fetching (LP: #228268)
  * Create the /etc/apt/sources.list properly (LP: #218195)
  * Use a tmpfs for $WORKINGDIR to avoid case when file system is mounted
    with no suid (LP: #228744)
  * Unproper letters variable initialization (LP: #230312)
  * Option --net failed other than for Class C (LP: #232361)

  [ Loic Minier ]
  * Fix v / --verbose getopt parsing. (LP: #230319)
  * Compute the default ARCH with dpkg --print-architecture. (LP: #230323)
  * Add support for lpia.
    - Allow lpia arch, lpia and lpiacompat kernel flavours.
    - Use http://ports.ubuntu.com/ubuntu-ports as default mirror for lpia.
    - Update help/documentation.
  * Check Release files against the archive keyring; depend on ubuntu-keyring.
    (LP: #230334)

 -- Soren Hansen <email address hidden> Wed, 28 May 2008 11:36:02 +0200

Changed in ubuntu-vm-builder:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here

Changed in ubuntu-vm-builder:
status: New → Fix Committed
Steve Langasek (vorlon)
Changed in ubuntu-vm-builder:
milestone: ubuntu-8.04.1 → none
Revision history for this message
Steve Beattie (sbeattie) wrote :

I've reproduced the missing locale issue with the version of ubuntu-vm-builder in hardy-updates, 0.4-0ubuntu0.1, and can confirm that the version in hardy-proposed, 0.4-0ubuntu0.4, properly sets up locale and timezone settings.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in ubuntu-vm-builder (Ubuntu Hardy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.