nvie/rq — pull request #214 by JacobOscarson (2013-05-15 13:52:00+00:00)
Title: Writes an optional specified PID file on startup

Hello,

In my setup I'd benefit from being able to write a PID file on startup. I've made this rather minimalistic implementation but I guess it could be a little bit more complete if it cleaned up it's PID file in `worker.py`, at least when a warm shutdown is requested. I can't see any obvious place where the startup configuration is kept, though so I couldn't didn't know the path of the PID file in `worker.Worker.request_stop` yet.

If you're interested in merging, I see too immediate possibilities:

1. Let the `--pid` / `PID_FILE` configuration option have the caveat of not deleting old PID files (I'd use it anyway).
2. Find a way to let `worker.Worker.request_stop` access configuration from `rq.script.rqworker` et. al. (which might complicate things unnecessarily).

What do you think?