小编wan*_*onk的帖子

在 RedHat/CentOS 中将二进制文件作为服务运行

我创建了一个脚本来将二进制文件作为服务执行。但是该服务不会启动该服务,但是当我停止该服务时,它会显示多个 pid。

我正在使用 RHEL 7.Here 是完整的细节

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
Run Code Online (Sandbox Code Playgroud)

通常我们运行脚本如下 ./pipeline --config pipeline.conf

[Unit]
Description=Pipeline service

[Service]
Type=simple
User=cisco
ExecStart=/hfqp/bin/pipeline --config /hfqp/bin/pipeline.conf
Run Code Online (Sandbox Code Playgroud)

并且做了以下事情

systemctl daemon-reload
systemctl start pipeline.service
Run Code Online (Sandbox Code Playgroud)

即使这样也行不通。

这是错误日志

? pipeline.service - Pipeline service
   Loaded: loaded (/etc/systemd/system/pipeline.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2019-04-16 06:29:34 GMT; 19s ago
  Process: 10195 ExecStart=/home/cisco/bigmuddy-network-telemetry-pipeline/bin/executePipeline.sh --daemon (code=exited, status=1/FAILURE)
 Main PID: 9962 (code=exited, …
Run Code Online (Sandbox Code Playgroud)

bash service shell-scripting

1
推荐指数
1
解决办法
1103
查看次数

标签 统计

bash ×1

service ×1

shell-scripting ×1