johnbellone/consul-cookbook — pull request #16 by webcoyote (2014-06-06 23:59:53+00:00)
Title: Add support for runit

Since /etc/init.d doesn't handle application crashes gracefully by restarting the consul application, I've updated the service recipe to >optionally< use runit (controlled by node[:consul][:init_style] since runit does handle application crashes. I've configured the default init_style to 'init' so that any current users of the cookbook won't be surprised by this addition.

Runit can also change the user/group of the consul application so it doesn't have to run as root. If the user selects runit init_style I update the /etc/consul.d, /var/log/consul and /var/lib/consul directories to be owned by that user/group instead of root/root.

Let me know if you'd like any additional changes to accept this pull request. I've tested my changes, and am running this in a development environment, where it's working perfectly.

Thanks for creating this cookbook, by the way!