Skip to content

Commit

Permalink
Startup: Reset locale to en_US.UTF-8 in bin/elasticsearch
Browse files Browse the repository at this point in the history
Because the NetworkExceptionHelper class relies on the english language in
order to extract information and decide whether a certain exception is a
network problem, we need to set the english locale on startup in order
to prevent other locales to circumvent this check.
  • Loading branch information
spinscale committed May 27, 2014
1 parent 1dc186a commit 5fdb35f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/elasticsearch
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ launch_service()
es_parms="$es_parms -Des.pidfile=$pidpath"
fi

# Make sure we dont use any predefined locale, as we check some exception message strings and rely on english language
# As those strings are created by the OS, they are dependant on the configured locale
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

# The es-foreground option will tell Elasticsearch not to close stdout/stderr, but it's up to us not to daemonize.
if [ "x$daemonized" = "x" ]; then
es_parms="$es_parms -Des.foreground=yes"
Expand Down

0 comments on commit 5fdb35f

Please sign in to comment.