2

I am on Ubuntu 14.04 server and I am trying to write a script for my database. I have added the file /etc/init/neo.conf. The file is the following:

description "neo4j upstart"

start on startup
stop on shutdown

script
  echo $$ > /var/run/neo_start.pid
  exec /home/ubuntu/neo/neo4j-enterprise-2.3.1/bin/neo4j start
end script

pre-start script
  echo "[`date`] Neo4j Starting" >> /var/log/neo.log
end script

pre-stop script
  rm /var/run/neo_start.pid
  echo "[`date`] Neo4j Stopping" >> /var/log/neo.log
end script

sudo service neo start works fine but sudo service neo stop tells me: stop: Unknown instance:.

Any ideas? Maybe something to do with the PID?

  • Where does neo_start.pid come from? – Francesco Boi Jul 2 '19 at 9:36
  • Do you solve this problem? Can you post a script example please? – Francesco Boi Jul 2 '19 at 11:31
1

Looks like bin/neo4j start creates it's own daemon process that upstart loses sight of. If you use bin/neo4j console upstart will be able to keep track of it like a normal process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.