Setting up simple Upstart Service

Service are important when you decide to monitor or keep a job running on your server
Upstart made it easy like heaven to add new service taking care  of controlling the service,
Here is an example how to setup very simple service and control it afterwards easy as this :

# Ubuntu / Debian
cd /etc/init
touch mysimpleservice.conf

and inside the conf file let’s define our service properties

# Ubuntu / Debian
vi mysimpleservice.conf
# inside the file
################mysimpleservice.conf

description "do some magic"
author " User"

###Define here which running levels you want your service starts/or stop

start on runlevel [2345]
stop on runlevel [016]

### restart automatically if process/script/command crachs

respawn

#### the action part or what you want the service to do

script

###< run set of command/s or maybe refer to another script or executable >
exec

end script
  1. No comments yet.

  1. No trackbacks yet.