Rather than the traditional detached daemonizing approach, what about connected to an existing supervisor instance (or creating/daemonizing one if not found) and then having that instance fork() off the app? That supervisor could then monitor the process directly without detaching it and use standard parent/child signalling to supervise instead pid files.

Would alter the environment inheritance depending on whether a new supervisor is created or not, so the current environment would have to be sent to the supervisor along with any args... I'm sure I'm missing some big gotcha..