On 03/01/2015 01:13, Avery Payne wrote:
I'm thinking "spawn to background and exit just after that".
That solves the problem I mentioned, but creates other ones. If ./finish is about cleanup, and you background it, then ./run may start again before the cleanup has completed, so there will be competition for resources, and race conditions. If the service starts again, then dies again, you will have two concurrent ./finish processes. More race conditions, unless they are reentrant, which is a heavy constraint on a finish script. If the service is in a failure loop and dies faster than cleanup completes, you will have an accumulation of ./finish processes, which will end up eating a lot of resources. You do not want to risk cascading failure. All in all, I think it's safer not to background ./finish, and just make sure it doesn't block.
Right now I'm having an internal dialog about if I should have an environment variable that "hints" the framework to the scripts, which in turn would allow me to support framework-specific features. I like the idea but I'm concerned that it will be unmaintainable without templates.
Welcome to the wonderful world of integration! As you must have guessed by now, DJB, Wayne, Gerrit and I regularly meet in secret to find new ways to make you pull your hair out, and we've decided that we really went too easy on you in 2014, so expect more work in 2015. ;) -- Laurent