Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j Start Error: /var/run/neo4j/neo4j.pid: No such file or directory

Tags:

neo4j

After upgrading from Neo4j 3.0 to 3.1 (and subsequently 3.2), I get the following error after running sudo neo4j start:

/usr/share/neo4j/bin/neo4j: line 411: /var/run/neo4j/neo4j.pid: No such file or directory

Nonetheless, Neo4j is actually running after running this command.. However, I cannot then stop Neo4j afterwards with sudo neo4j stop, as there is no PID.

How can I fix this?


Notes:

  • I upgraded using sudo apt upgrade
  • It is possible to get around this issue by doing a sudo mkdir /var/run/neo4j beforehand, but was hoping there might be a more effective solution.
like image 531
inersha Avatar asked Dec 10 '22 10:12

inersha


1 Answers

When using the installation package you should not start/stop with the neo4j script, but use the installed service. Depending on your Ubuntu version that is

sudo service neo4j {start|stop|restart}

or

sudo systemctl {start|stop|restart} neo4j

Check http://neo4j.com/docs/operations-manual/current/installation/linux/debian/ and http://neo4j.com/docs/operations-manual/current/installation/linux/systemd/ for more information.

Hope this helps, Tom

P.S. Note that starting/stopping without using the service may have started Neo4j with the wrong user (root instead of neo4j) and files may therefore have the wrong ownership now !

like image 138
Tom Geudens Avatar answered May 29 '23 01:05

Tom Geudens