| 1 | #!/sbin/openrc-run |
| 2 | |
| 3 | description="A highly scalable, robust native graph database" |
| 4 | |
| 5 | : ${cfgdir:="/etc/neo4j"} |
| 6 | : ${homedir:="/var/lib/neo4j"} |
| 7 | : ${command_user:="neo4j"} |
| 8 | : ${retry="TERM/30/KILL/5"} |
| 9 | : ${rc_ulimit="-n 40000"} |
| 10 | : ${start_wait:=1000} # milliseconds |
| 11 | |
| 12 | command="/usr/bin/neo4j" |
| 13 | command_args="console $command_args" |
| 14 | command_background="yes" |
| 15 | directory="$homedir" |
| 16 | pidfile="/run/$RC_SVCNAME.pid" |
| 17 | |
| 18 | start_stop_daemon_args="--wait $start_wait $start_stop_daemon_args" |
| 19 | # The leading space is to avoid fallback to $start_stop_daemon_args when this |
| 20 | # is empty (supervise-daemon doesn't support --wait). |
| 21 | supervise_daemon_args=" $supervise_daemon_args" |
| 22 | |
| 23 | depend() { |
| 24 | need localmount net |
| 25 | after firewall |
| 26 | } |
| 27 | |
| 28 | start_pre() { |
| 29 | export NEO4J_CONF="$cfgdir" |
| 30 | export NEO4J_HOME="$homedir" |
| 31 | |
| 32 | # Neo4j writes its own pid file into this directory. |
| 33 | checkpath -d -q -m700 -o "$command_user" /run/neo4j |
| 34 | } |