I have created the service « /etc/systemd/system/My_App_Neo4j.service » with the following content :
Code: Select all
[Unit]
Description=This script start Neo4j at the boot
[Service]
Type=simple
#User=My_App_user
ExecStart=/opt/My_APP/Neo4j/initd.sh start
ExecReload=/opt/My_APP/Neo4j/initd.sh restart
ExecStop=/opt/My_APP/Neo4j/initd.sh stop
TimeoutStartSec=0
[Install]
WantedBy=default.target
Code: Select all
systemctl daemon-reload
Code: Select all
systemctl enable My_App_Neo4j.service
systemctl start My_App_Neo4j.service
Code: Select all
[My_App_user@ip-my-machine ~]$ sudo systemctl status My_App_Neo4j.service
● My_App_Neo4j.service - This script start Neo4j at the boot
Loaded: loaded (/etc/systemd/system/My_App_Neo4j.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2018-01-18 17:45:17 UTC; 13s ago
Process: 1518 ExecStart=/opt/MY_APP/Neo4j/initd.sh (code=exited, status=2)
Main PID: 1518 (code=exited, status=2)
Jan 18 17:45:17 ip-192-168-0-98.eu-west-1.compute.internal systemd[1]: Started This script start Neo4j at the boot.
Jan 18 17:45:17 ip-192-168-0-98.eu-west-1.compute.internal systemd[1]: Starting This script start Neo4j at the boot...
Jan 18 17:45:17 ip-192-168-0-98.eu-west-1.compute.internal initd.sh[1518]: Usage: /opt/MY_App/Neo4j/initd.sh {start|stop...us}
Jan 18 17:45:17 ip-192-168-0-98.eu-west-1.compute.internal systemd[1]: My_App_Neo4j.service: main process exited, code=exite...ENT
Jan 18 17:45:17 ip-192-168-0-98.eu-west-1.compute.internal systemd[1]: Unit My_App_Neo4j.service entered failed state.
Jan 18 17:45:17 ip-192-168-0-98.eu-west-1.compute.internal systemd[1]: My_App_Neo4j.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Eg.
Code: Select all
$ /opt/My_APP/Neo4j/initd.sh status
Neo4j is not running
$ /opt/MY_APP/Neo4j/initd.sh start
Active database: graph.db
Directories in use:
home: /opt/MY_APP/Neo4j/neo4j-enterprise-3.2.3
config: /opt/MY_APP/Neo4j/neo4j-enterprise-3.2.3/conf
logs: /home/airnavx_user/local/logs/neo4j
plugins: /opt/MY_APP/Neo4j/neo4j-enterprise-3.2.3/plugins
import: /mnt/airnavx/data/cypher
data: /home/airnavx_user/local/data
certificates: /opt/MY_APP/Neo4j/neo4j-enterprise-3.2.3/conf/ssl
run: /home/airnavx_user/local/run
Starting Neo4j.
Started neo4j (pid 1749). It is available at http://0.0.0.0:7474/
This HA instance will be operational once it has joined the cluster.
See /home/airnavx_user/local/logs/neo4j/neo4j.log for current status.
0 Neo4j started
$ /opt/MY_APP/Neo4j/initd.sh status
Neo4j is running at pid 1749
Cordially.