I have an integration where the following happens:
* a pyramid application may be running, or not, on port 7201
* a background process may spin up a variant of the pyramid application on port 7202
* nginx has a location block that is configured to look for a semaphore file, if found it proxies to the application on 7201; otherwise it proxies to 7202.
pserve no longer has a pid file, so I can't use that as a semaphore.
i can use events to create the file, but it doesn't seem like I can hook removing the file into anything. there are no applicable events, and there is no "finally" block on the pserve run commands.
has anyone been able to manage something like this entirely with pserve? i'd like to dummy-proof this integration, but it doesn't seem like I can figure out a way to reliably remove the semaphore file on a pserve/waitress shutdown.