Run a python script that is never Killed
6,550
I would recommend adding this code to your script http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
Or use screen.
Edit: This is a little more modern but I haven't used it(I use something custom) http://pypi.python.org/pypi/python-daemon
Related videos on Youtube
Author by
donald
Updated on September 18, 2022Comments
-
donald over 1 year
I have a script running
python script.py
in a new screen but sometimes the script gets killed:18 21 Restarting processes... done 2 Killed
How can I protect the script from being killed even when I close the console? Shall I use & or nohup?
-
Kyle Smith about 12 yearsAre you the sole administrator of the system? I just did a quick test and that "Killed" output is not what is displayed when you send Python a
SIGKILL
orSIGTERM
.
-
-
donald about 12 yearsI use screen but the script seems to be killed without any error.
-
donald about 12 yearsI use screen but the script seems to be killed without any error.