Skip to main content

Posts

Showing posts from July, 2013

Wondering how to start/stop a Python script from init.d ?

If you just looking for the solution please go to solution heading directly!! So I have been asked to start my python server at the time of boot up. As I am pretty new to Python and have never done this, I have to go and find some help from none other than our best bud google. So when I googled I had found couple solution like http://www.pietervanos.net/knowledge/start-python-script-from-init-d/ The problem with the above solution is that when you want to stop your Python script using the above solution it kills all of the python scripts running on the machine. Obviously we don't want to kill other Python script, don't we? And had found couple of other solutions which I was not able to understand or I could not make them work. So the solution which I am using is. Solution : The plan is to make your Python script in my case my Python server to store its pid in some file, lets say in location /var/run/your_script.pid. So I am making your life easy, use this bel