Systemd stops OrientDB immediately after it starts on Ubuntu 16.04

I am trying to run OrientDB as a daemon (included at the beginning) on ​​Ubuntu 16.04 LTS. The problem is that systemd seems to cause a stop immediately after I started it. I have this systemd service file exactly as recommended in the OrientDB documentation:

[Unit] Description=OrientDB Server After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] Type=forking ExecStart=$ORIENTDB_HOME/bin/orientdb.sh start ExecStop=$ORIENTDB_HOME/bin/orientdb.sh stop ExecStatus=$ORIENTDB_HOME/bin/orientdb.sh status 

orientdb.log:

  . .` ` , `:. `,` ,:` .,. :,, .,, ,,, . .,.::::: ```` ::::::::: ::::::::: ,` .::,,,,::.,,,,,,`;; .: :::::::::: ::: ::: `,. ::,,,,,,,:.,,.` ` .: ::: ::: ::: ::: ,,:,:,,,,,,,,::. ` ` `` .: ::: ::: ::: ::: ,,:.,,,,,,,,,: `::, ,, ::,::` : :,::` :::: ::: ::: ::: ::: ,:,,,,,,,,,,::,: ,, :. : :: : .: ::: ::: ::::::: :,,,,,,,,,,:,:: ,, : : : : .: ::: ::: ::::::::: ` :,,,,,,,,,,:,::, ,, .:::::::: : : .: ::: ::: ::: ::: `,...,,:,,,,,,,,,: .:,. ,, ,, : : .: ::: ::: ::: ::: .,,,,::,,,,,,,: `: , ,, : ` : : .: ::: ::: ::: ::: ...,::,,,,::.. `: .,, :, : : : .: ::::::::::: ::: ::: ,::::,,,. `: ,, ::::: : : .: ::::::::: :::::::::: ,,:` `,,. ,,, .,` ,,. `, GRAPH DATABASE `` `. `` orientdb.com ` pid file detected, killing process 

Syslog:

 Jul 28 18:56:34 ubuntu systemd[1]: Starting OrientDB Server... Jul 28 18:56:34 ubuntu orientdb.sh[17487]: Starting OrientDB server daemon... Jul 28 18:56:34 ubuntu systemd[1]: Created slice User Slice of orientdb. Jul 28 18:56:34 ubuntu systemd[1]: Starting User Manager for UID 999... Jul 28 18:56:34 ubuntu systemd[1]: Started Session c5 of user orientdb. Jul 28 18:56:34 ubuntu systemd[17497]: Reached target Timers. Jul 28 18:56:34 ubuntu systemd[17497]: Reached target Paths. Jul 28 18:56:34 ubuntu systemd[17497]: Reached target Sockets. Jul 28 18:56:34 ubuntu systemd[17497]: Reached target Basic System. Jul 28 18:56:34 ubuntu systemd[17497]: Reached target Default. Jul 28 18:56:34 ubuntu systemd[17497]: Startup finished in 23ms. Jul 28 18:56:34 ubuntu systemd[1]: Started User Manager for UID 999. Jul 28 18:56:34 ubuntu orientdb.sh[17508]: Stopping OrientDB server daemon... Jul 28 18:56:34 ubuntu systemd[1]: Started Session c6 of user orientdb. Jul 28 18:56:34 ubuntu systemd[1]: Started OrientDB Server. Jul 28 18:56:34 ubuntu systemd[1]: Stopping User Manager for UID 999... Jul 28 18:56:34 ubuntu systemd[17497]: Reached target Shutdown. Jul 28 18:56:34 ubuntu systemd[17497]: Starting Exit the Session... Jul 28 18:56:34 ubuntu systemd[17497]: Stopped target Default. Jul 28 18:56:34 ubuntu systemd[17497]: Stopped target Basic System. Jul 28 18:56:34 ubuntu systemd[17497]: Stopped target Timers. Jul 28 18:56:34 ubuntu systemd[17497]: Stopped target Paths. Jul 28 18:56:34 ubuntu systemd[17497]: Stopped target Sockets. Jul 28 18:56:34 ubuntu systemd[17497]: Received SIGRTMIN+24 from PID 17536 (kill). Jul 28 18:56:34 ubuntu systemd[1]: Stopped User Manager for UID 999. Jul 28 18:56:34 ubuntu systemd[1]: Removed slice User Slice of orientdb. 

Any ideas?

+5
source share
4 answers

While you are completing your own initialization scripts ( orientdb.sh , server.sh , shutdown.sh ) in the systemd system module, you will have a strange and difficult debugging task.

Instead, you should read these scripts, understand how they launch OrientDB, and reproduce only what is needed in the service unit.

0
source

I added the user and group orientdb to the system and used the systemd script below (assuming orientdb is set to / opt / orientdb):

 [Unit] Description=OrientDB Server After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=orientdb Group=orientdb ExecStart=/opt/orientdb/bin/server.sh ExecStop=/opt/orientdb/bin/shutdown.sh ExecReload=/bin/kill -HUP $MAINPID 
0
source

If you start the server and close the window, the server will be closed. Use it with NOHUP (server.sh), and if you close the window, it will continue.

I had the same problem, good luck

0
source

I had the same problem with OpenSuse Leap 42.1 and OrientDB 2.2.7. Roberto's answer was decided. See the GitHub question .

0
source

All Articles