Python: module for creating PID-based lockfile?

David Wolever picture David Wolever · Sep 18, 2009 · Viewed 20.3k times · Source

I'm writing a Python script that may or may not (depending on a bunch of things) run for a long time, and I'd like to make sure that multiple instances (started via cron) don't step on each others toes. The logical way to do this seems to be a PID-based lockfile… But I don't want to re-invent the wheel if there is already code to do this.

So, is there a Python module out there which will manage the details of a PID-based lockfile?

Answer

ennuikiller picture ennuikiller · Sep 18, 2009

This might be of help to you: lockfile