hw-cookbooks/graphite — pull request #33 by eladroz (2013-03-04 10:22:47+00:00)
Title: Fix RedHat support

Hi,
Fixed a few things that just didn't work for me in a brand new default-centos-63:

1. /opt/graphite/storage/log was not created explicitly with apache user/group ownership permissions, so carbon-cache failed to create its sub-folder there.

The explicit creation was removed in commit https://github.com/hw-cookbooks/graphite/commit/6e9c683d4e63e529e7e9a814f49e094daeaab10c, but due to http://tickets.opscode.com/browse/CHEF-1621 you can't rely on recursive directory creation to set ownership "along the way".

I also moved the creation of the 'storage/whisper' folder to the carbon recipe, where I think it belongs.

2. The /etc/init.d/carbon-cache service captured the PID of a 'sudo' command. Not sure how this worked for @chrislundquist, but for me this was probably the PID of some wrapper process which died once the sudo-ed process was launched. When running 'service carbon-cache status', it always checked that dead PID.

Instead of sudo, I used the daemon procedure from /etc/init.d/functions to start the process. This doesn't give you the PID - but the PID file is created anyway by carbon-cache under storage/carbon-cache/carbon-cache-a, so we should just use that

As a side-effect, the $CC_LOG would now only catch startup errors, but for anything else you should look at console.log anyway, which is time-stamped.

Btw, @chrislundquist, I think that using the standard /etc/init.d/function we can greatly simplify & shorten the service script.