Can't start an application as service, but running as standalone process simply works

You have to remove /var/run/cassandra folder hence it has wrong permissions:

sudo rm -rf /var/run/cassandra

Or you can fix permissions manually:

sudo chmod 750 /var/run/cassandra

Then start Cassandra as service:

sudo service cassandra start


Some explanations

Instructions of file permissions you can find here.

  • It is safe to delete that folder because it recreates with right permissions and content. But do not delete it once it works correct. It may result in loss of data or incorrect behavior.

  • chmod 750 decrypts as rwxr-x--- permissions. It allows read-write-execute to the user, read-execute to the group and nothing to others. For Cassandra, it is enough to set permissions so.


This solution can be achieved the following way:

$ sudo vim /etc/init.d/cassandra;

Find the following line:

CMD_PATT="cassandra.+CassandraDaemon"

Replace by:

CMD_PATT="cassandra"

Save and stop and start again. Service will get status correctly; Tested on cassandra 2.3

Source here: https://www.digitalocean.com/community/tutorials/how-to-install-cassandra-and-run-a-single-node-cluster-on-ubuntu-14-04 (check STEP 3)