Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bin/install-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,10 @@ EOF
chmod a+rx /etc/rc.local
}

generate_locales
set_locale
if [ $SITE = "fixmystreet" ]; then
generate_locales
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to make the locales available to all systems so that the SSH session can pick the one it requires.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All generate_locales does is install language-pack-en (if present, so Ubuntu) and add an en_GB locale. I don't think it does anything that prevents making locales available to any system.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding (which could well be wrong!) is that you need to make the locales available through dpkg-reconfigure locales. Basically this step:

screen shot 2014-07-18 at 10 49 49

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installation of the locales package runs locale-gen postinst, so any locale chosen at server set up is already available. I'm not sure it feels right for an install script to install every possible locale, just in case? Vagrant's puppetlabs/debian-7.4-64-nocm, puppetlabs/debian-6.0.9-64-nocm, and ubuntu/precise64 all have a default of en_US.UTF-8, for what it's worth. If the default is None, then yes, you need to make sure the locale passed by SSH is installed on the server in order for it to work. Perhaps this script should instead do the following:

  • Check what locale has come over SSH - if it's UTF-8, make sure that it is installed and that the server has no default, and then continue;
  • Otherwise, check if the server has a default, and that it's UTF-8, and if so continue;
  • Otherwise, set up en_GB.UTF-8 as now so that installation will proceed smoothly (e.g. in mapit's case, install_postgis requires a UTF-8 locale).
    Does that work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds ideal.

set_locale
fi

add_unix_user

Expand Down