I am running my Python script using upstart feature of Ubuntu so that if for whatever reason my Python script dies or gets killed, it can be restarted automatically.
So I decided to use UPSTART feature of Ubuntu to restart the Python script automatically.
After creating the testing.conf file like this in
chdir /tekooz exec python testing.py respawn
I ran below sudo command to start it and I can see that process running using
ps ax and my python script is also running fine.
root@bx13:/tekooz# sudo start testing testing start/running, process 27794
This is my below python script -
#!/usr/bin/python import time while True: print "Hello World" time.sleep(5)
But how do I test it to see if my Python script gets killed, then it is getting restarted automatically? I cannot kill the
PID as the PID keeps on changing if I do
ps ax on my
Can anyone tell me how to test this scenario? I am just trying to make sure my script can be restarted automatically if it gets killed or dies.