title: Running a Python service on ubuntu using upstart
body: <p>I want to create to deploy a heartbeat service (a python script) as a service using Upstart. </p>
  
  <p>My understanding is that I've to add a <code>/etc/init/myheartbeatservice.conf</code> with the following contents. </p>
  
  <pre><code># my heartbeat service 
  
  description     "Heartbeat monitor"
  
  start on startup
  stop on shutdown
  
  script
      exec /path/to/my/python/script.py
  end script 
  </code></pre>
  
  <p>My script starts another service process and the monitors the processes and sends heartbeat to an outside server regularly. Are <code>startup</code> and <code>shutdown</code> the correct events ? 
  Also my script create a new thread. I'm assuming I also need to add <code>fork daemon</code> to my conf file?</p>
  
  <p>Thanks. </p>