OrientDB as a daemon on Ubuntu not stopping

268 Views Asked by At

Followed the documentation for Installing orientdb on Linux/Ubuntu on the following location, http://orientdb.com/docs/2.1/Unix-Service.html

Set the following variables : JAVA_HOME, JRE_HOME, ORIENTDB_HOME and the following changes in the below files,

orientdb.sh

#!/bin/sh
# OrientDB service script
#
# Copyright (c) Orient Technologies LTD (http://www.orientechnologies.com)

# chkconfig: 2345 20 80
# description: OrientDb init script
# processname: orientdb.sh

# You have to SET the OrientDB installation directory here
ORIENTDB_DIR="/local/some-location"
ORIENTDB_USER="some-user"

Installing for systemmd /etc/systemd/system/orientdb.service

[Unit]
Description=OrientDB Server
After=network.target
After=syslog.target

[Install]
WantedBy=multi-user.target

[Service]
Type=forking
ExecStart=/local/some-location/bin/orientdb.sh start
ExecStop=/local/some-location/bin/orientdb.sh stop
ExecStatus=/local/some-location/bin/orientdb.sh status

It is possible to start the service by the following command

systemctl start orientdb.service

But the service will not stop after giving the following command

systemctl stop orientdb.service

Machine Info :

  • Java 8.0_31
  • Orientdb 2.1.12
  • Ubuntu 15.04 on Virtual Box VM
2

There are 2 best solutions below

1
Ivan Mainetti On BEST ANSWER

modify your service file according to this:

$ cat /etc/systemd/system/orientdb.service

[Unit]
Description=OrientDB Server
After=network.target
After=syslog.target

[Install]
WantedBy=multi-user.target

[Service]
User=<USER>
Group=<GROUP>
ExecStart=<ORIENTDB_INSTALL_PATH>/bin/server.sh
SuccessExitStatus=143

modifying with your user,group and path.

than reload the service systemctl daemon-reload

Using this is working for me on Fedora23.


Let me know.

Ivan


EDIT

Tried on Ubuntu 15.04 and it works.

1
Oleksandr Gubchenko On

There is an issue with shutdown on 2.1.x See: Joe Taras comment. You should update to the latest 2.2.x version.