karmi/cookbook-elasticsearch — pull request #49 by maf23 (2013-01-17 14:46:29+00:00)
Title: Do not use the '-' flag to su since it create a login shell. Doing that

will prevent the environment from beeing inherited unless you also use '-m'.

But using '-' and '-m' when running bash will cause the launched shell to
try to read $HOME/.bash_profile since $HOME still refers to the home
directory of root and teh elasticsearch user does not have read access there.

A simple solution is to omit '-' and '-m'. The program will still run under
the elasticsearch user but will inherit environment variables and not
print an error message.