Re: Emulate pipe-tools' finish script using daemontools?
Jos Backus <[email protected]> Fri, 30 Jun 2006 21:02:57 -0701
| Newsgroups | gmane.comp.djb.syslog |
|---|---|
| Message-ID | <[email protected]> |
On Sat, Jul 01, 2006 at 10:00:05AM +0930, Daryl Tester wrote: > Jos Backus wrote: > I read through that as well. While I understood the initial problem, I > wasn't so sure about the subsequent problems that thread raised. For > example, if postrun needs to influence the subsequent run script in any > fashion other than svc manipulation, it could modify the context > appropriately, like writing to the env directory. Although there is > a cycle between run and postrun being invoked, I wanted to emphasize > that they're really separate iterations with information flow primarily > from run script to postrun. i.e. I considered feeding the postrun exit > status back to run, but rejected it for that reason - postrun influences > through action, not information (although those actions may result in > information being produced). Those are good points. > >Since I need a solution _now_ I'm going to go with Daryl's daemontools > >patch > >but will rename his `postrun' script to `finish' for compatibility reasons. > > That's your choice, but bear in mind I don't think they're 100% compatible. I know. Perhaps they should just adopt your choice since you seem to have given it quite a bit of thought. A good plan today is better than a perfect plan next month. > >On the topic of `finish' script compatibility: if the three approaches > >cannot > >agree on a standard calling convention it would be useful for a finish > >script > >to be able to detect under which supervision tool it is being run. That > >eases > >migration between the various solutions. > > My solution to that would be to have the postrun script invoke the finish > script, after suitable mangling of the arguments. If nothing executes > postrun, then you're not using my patch and finish is free to be invoked > by other methods. :-) True. But I wanted to minimze the number of files. Plus I'm trying to evangelize daemontools as a solution to begin with (it's not a no-brainer everywhere as you probably know) and I've already made people comfortable with the `finish' script because I saw the other implementations before yours. Since this is to be run on CentOS I'll have to re-roll the rpm I use with your patch and I'm all set for now. I'd rather not patch stuff to begin with but it doesn't seem likely that this functionality will be available in the stock daemontools any time soon (if ever), and I can't use it without this functionality. Thanks for the patch Daryl! > Cheers. > > -- > Regards, > Daryl Tester, IOCANE Pty. Ltd. > -- Jos Backus jos at catnook.com