Running Python service on ubuntu using upstart

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

I understand what I have to add /etc/init/myheartbeatservice.conf

with the following content.

# 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 monitors the processes and sends a pulse to the external server regularly. Whether startup

and shutdown

regular events? Also my script will create a new thread. I'm guessing I also need to add fork daemon

to my conf file?

Thank.

+3


source to share


1 answer


Upstart only sets a few environment variables. Is your application required for any of these sets?



See the answer to a similar question: Need help running a Python application as a service on Ubuntu using Upstart

+1


source







All Articles