I have a python script that periodically generates a png image, and puts it on a server that I can access through a browser. The image displays the progress of a job I am running on the server. I'm using matplotlib to generate the images.
The python script goes to sleep after generating each image. After an hour, it wakes up, generates a new image, and then goes back to sleep.
I start the script over an ssh session. When I log off, the script gets killed. I've read the other threads covering this problem, but the proposed solutions do not work. The script is killed after I log off, even if I run it with
nohup script.py &> job-monitor.log &
or if I run it like this
script.py [Ctrl-Z] disown -h %1 bg 1
The strange thing is, when I log off and log back in, the script is no longer running, and job-monitor.log is empty.
What could be happening, and how do I get the script to continue running after I log off?
Additional information: I think the problem has to do with the plotting library I'm using, matplotlib. I think it may require an X session to produce a png, even though the graphic is just being saved to disk.