【问题标题】:OrientDB as a daemon on Ubuntu not stoppingOrientDB 作为 Ubuntu 上的守护进程不会停止
【发布时间】:2016-09-13 10:37:36
【问题描述】:

按照以下位置在 Linux/Ubuntu 上安装 orientdb 的文档进行操作,http://orientdb.com/docs/2.1/Unix-Service.html

在以下文件中设置以下变量:JAVA_HOME、JRE_HOME、ORIENTDB_HOME 和以下更改,

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"

为 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

可以通过以下命令启动服务

systemctl start orientdb.service

但是在给出以下命令后服务不会停止

systemctl stop orientdb.service

机器信息:

  • Java 8.0_31
  • Orientdb 2.1.12
  • Virtual Box VM 上的 Ubuntu 15.04

【问题讨论】:

  • 您遇到错误了吗?您可以发布它并共享日志以进行调查吗?谢谢。
  • @OleksandrGubchenko 在执行命令“systemctl status orientdb.service”时打印“Stopped OrientDB Server”。

标签: linux ubuntu orientdb ubuntu-15.04


【解决方案1】:

根据这个修改你的服务文件:

$ 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

使用您的用户、组和路径进行修改。

比重新加载服务systemctl daemon-reload

在 Fedora23 上使用它对我有用。


告诉我。

伊万


编辑

在 Ubuntu 15.04 上试过,它可以工作。

【讨论】:

  • 谢谢@Ivan。您给出的答案适用于对 orientdb.service 文件的一些更改。关闭服务“ExecStop=/bin/shutdown.sh”
【解决方案2】:

在 2.1.x 上存在关机问题,请参阅:Joe Taras 评论。您应该更新到最新的 2.2.x 版本。

【讨论】:

  • 可以使用 bin 目录下的内置 sh 文件“orientdb.sh stop”命令或“shutdown.sh”命令关闭服务器。我觉得不是那个问题。
最近更新 更多