init.d脚本无法手动执行,并且在重新启动后无法正常工作

时间:2019-07-17 05:56:00

标签: init init.d

在centos 7中,我正在编写一个自定义脚本,该脚本希望在重新启动时运行以启动服务。

我已使用以下代码保存了文件,并具有以下权限: chkconfig-添加健康 chkconfig-345级运行状况 chkconfig-列表 并在列表中添加了服务。但是当我像./health这样手动运行时,假设它没有运行,那么什么也没显示,因此在启动时它不起作用。

#!/bin/sh
### BEGIN INIT INFO
# Provides:          health
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: health service
# Description:       Start health go lang service
#  This script will start the health REST API service
### END INIT INFO
/opt/array/scripts/health.sh >> /opt/array/logs/health.log

0 个答案:

没有答案
相关问题