lusis/chef-logstash — pull request #90 by srenatus (2013-02-28 17:01:03+00:00)
Title: Reworked the initscript to fix issue #82

Having been hit by issue #82, I reworked the kibana initscript and the `logstash::kibana` recipe as follows:

1. the `kibana` user's shell is set to Bash,
2. the passed environment variables are set in `kibana`'s `~/.bash_profile`
3. ... which is sourced when `su` is called with `-`, i.e. `su - kibana -c "$KIBANA_CMD"` in the initscript (mind the quotes).

I'm a little unsure if the `.bash_profile` approach isn't too non-obvious for someone examining the system; but it does work now (I tested both `lucid*` images) and the environment is clean apart from the variables *passed explicitly* (i.e. in kibana's `.bash_profile`). I was tempted to rewrite the init script to make use of `start-stop-daemon` and get rid of `kibana-daemon.rb`, but my knowledge of daemons in Ruby doesn't suffice to decide that.

(There're further two rather trivial changes, I moved the `kibana` user related stuff into the `ruby` branch of the kibana recipe; and made kibana's log and pid dir configurable.)

Hope this helps resolving the issue. Last but not least, thank you for your work with this recipe! `:)`