1

I have this following setup but its not working in my 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)

Step 1: 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

Step 2:

$ service a start
a: unrecognized service

How do i run it please?

  • 3
    initctl start a – Patrick Nov 4 '14 at 1:20
  • I just applied and i checked the process, but now its running my a.js twice. i have two time same server script running. – YumYumYum Nov 4 '14 at 1:22
-1

That looks like an upstart service. You can run it using:

initctl start a

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.