Python service using Upstart on Ubuntu

Posted by Soumya Simanta on Ask Ubuntu See other posts from Ask Ubuntu or by Soumya Simanta
Published on 2012-04-03T10:10:02Z Indexed on 2012/04/03 11:41 UTC
Read the original article Hit count: 280

Filed under:
|

I want to create to deploy a heartbeat service (a python script) as a service using Upstart.

My understanding is that I've to add a /etc/init/myheartbeatservice.conf with the following contents.

# my heartbeat service 

description     "Heartbeat monitor"

start on startup
stop on shutdown

script
    exec /path/to/my/python/script.py
end script 

My script starts another service process and the monitors the processes and sends heartbeat to an outside server regularly. Are startup and shutdown the correct events ? Also my script create a new thread. I'm assuming I also need to add fork daemon to my conf file?

Thanks.

© Ask Ubuntu or respective owner

Related posts about upstart

Related posts about service