Re: how to wrap properly a Red Hat / CentOS service into a daemontools service ?

Rafal Bisingier <[email protected]> Wed, 5 Jan 2011 16:14:17 +0100
Newsgroups gmane.comp.djb.syslog
Message-ID <20110105161417.6a6f4fb2@puter>
Serwus,

Dnia Wed, 5 Jan 2011 15:01:25 +0100
Romain Pelisse <[email protected]> napisaƂ(a):


> Thanks for your answer. I'm happy to know that I'm not the only one thinking
> about this. I'll like your approach, and especially like the idea of having
> the "status" option of the service working (however, this can also be
> confusing if somebody is led to believe that service xxx stop will work as
> suspected - probably need to map this to the daemontools equivalent).
> 
> Anyhow, it sounds to me that you actually wrote your own init.d script
> rather than reusing the one provided by the distribution for instance, if I
> want to daemontoolize nginx I need to wrote myself an /etc/init.d/nginx
> scripts rather than use in my run script the one already provided by
> package.
> 
> About that, I just wonder, did you try to salvage those scripts (as they
> are) - and maybe run into any issue preventing you to do so ? I did a quick
> tryout and it fails but I'm wondering if I maybe missing something important
> (such as "it simply can't work because of ...."). If there is no reason I
> couldn't reuse those script - simply by calling them inside my "run" script,
> I guess it would be a nice approach to smoothly integrate packaged apps into
> daemontools.

It simply can't work because daemontools require service to stay in
foreground for its whole lifetime, but rcscripts do exactly the
opposite: fork services into background. So the only way is to write
(or find on net) a run script on your own.

-- 
Greetings
Rafal Bisingier