travis-ci/travis-cookbooks — pull request #134 by iconara (2013-01-14 07:12:33+00:00)
Title: Fixed problem in Cassandra init script

Updated the Cassandra init script so that the `cassandra` service starts properly and shuts down cleanly.

I believe this should fix https://github.com/travis-ci/travis-ci/issues/840

The current script repeats most of what's in `/usr/local/cassandra/bin/cassandra`, but not enough, there's a lot of the environment Cassandra needs to start that is missing. This patch changes it so that it simply runs `cassandra -p $PIDFILE` and daemonizes it with `start-stop-daemon` (by way of `start_daemon`). The stop and status tasks had to change too.

The script still contains some hard coded paths and some interpolated, if you pass in another `conf_dir` or even `installation_dir` it will no longer work. I can fix that too if you'd like but I though that just fixing the issue at hand was best to start with. There's also some stuff that could be removed now when `/usr/local/cassandra/bin/cassandra` is doing most of the lifting (the part that finds `JAVA_HOME` for example).