CentOS - 创建了新贵脚本,但它根本没有运行

CentOS - 创建了新贵脚本,但它根本没有运行

我有以下设置,但它在我的 CentOS 6x 中不起作用(3.10.23-xxxx-std-ipv6-64 #1 SMP Tue Mar 18 14:48:24 CET 2014 x86_64 x86_64 x86_64 GNU/Linux)

步骤一:vi /etc/init/a.conf

description "a.js"
author "YumYumYum"

# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn

# When to start the service
start on runlevel [2345]

# When to stop the service
stop on runlevel [016]

# Automatically restart process if crashed
respawn

script
  echo $$ > /var/run/a.pid;
  exec node /var/tmp/signal/a.js
end script

post-stop script
  rm -f /var/run/a.pid
end script

第2步:

$ service a start
a: unrecognized service

请问我该如何运行它?

答案1

这看起来像是一个新贵服务。您可以使用以下命令运行它:

initctl start a

相关内容