Tuesday, July 1, 2014

How to install custom upstart script

To install custom upstart script, please follow below steps (in this example, I'll be using a service call cat):
  1. Copy the script into /etc/init 
  2. To make upstart distinguish the new service, run: 
    • $ initctl reload-configuration 
  3. Check whether your script is already in upstart by running:
    • $ initctl list | grep cat 
      cat stop/waiting
  4. And you are done, you can check the status of your service by running:
    • $ service cat status 
      cat stop/waiting
  5. You can also do the same with start, stop and restart
    • $ service cat start
      * Starting cat .... [OK]
    • $ service cat stop
      * Stopping cat .... [OK]
    • $ service cat restart * Restarting cat .... [OK]

No comments:

Post a Comment