Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 23997  / 3 Years ago, mon, june 21, 2021, 11:41:24

For a service although a pid file exists, but still when attempting to start service, it fails saying:



$ sudo service cassandra start
* could not access pidfile for Cassandra


I verified folder permissions under /var/run (whose owner is root) and the subfolder cassandra is owned by cassandra user, but still the service cannot access pid file even though I verified that pid file exists. (Also pid is allocated). So why does it say it can't access pidfile?



And running cassandra as a standalone process just works, but not just using service cassandra start



$ sudo ls -l /var/run/cassandra 
total 4
-rw-r--r-- 1 cassandra cassandra 4 Mar 18 07:33 cassandra.pid
$ sudo su
# ls -ld /var/run/cassandra
dr--r----- 2 cassandra cassandra 60 Mar 18 07:38 /var/run/cassandra


How do I make this work using sudo service cassandra start ?


More From » 12.04

 Answers
1

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.



[#26454] Monday, June 21, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
antorchestr

Total Points: 92
Total Questions: 111
Total Answers: 120

Location: Jordan
Member since Wed, Jun 17, 2020
4 Years ago
;