Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jul 2010 19:16:01 -0400
From:      Greg Larkin <glarkin@FreeBSD.org>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        ports@FreeBSD.org, Ed Schouten <ed@80386.nl>, rc@FreeBSD.org
Subject:   Re: General note on rc scripts and daemonizing
Message-ID:  <4C462E31.4030801@FreeBSD.org>
In-Reply-To: <alpine.BSF.2.00.1007201507350.11411@qbhto.arg>
References:  <20100717105658.GV1742@hoeg.nl> <4C461CA5.2040307@FreeBSD.org> <alpine.BSF.2.00.1007201507350.11411@qbhto.arg>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Doug Barton wrote:
> On Tue, 20 Jul 2010, Greg Larkin wrote:
[...]
>> Anyway, here are some examples for daemonizing processes that don't
>> already have support for doing it themselves:
>>
>> Daemonizing an executable without internal daemon support:
>> http://www.freebsd.org/cgi/cvsweb.cgi/ports/mail/nullmailer/files/nullmailer.in?rev=1.3;content-type=text%2Fplain
>>
>>
>> Daemonizing a Python script:
>> http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/viewvc/files/viewvc.in?rev=1.4;content-type=text%2Fplain
>>
>>
>> I would love to see direct support for these use cases in /etc/rc.subr,
>> and am interested in working with someone to add it.
> 
> Your first example looks right, I don't know enough about python to
> comment on the second. There is also
> http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/90163 which has some
> insight into this. I previously closed that PR, but now it may be time
> to revisit this problem.
> 
> I heartily encourage you to go forward if you're interested in patching
> rc.subr to take care of this. However, there will have to be a ramp-up
> period since even if you fix it today, you have about 3 years before you
> can guarantee that users on all supported versions of FreeBSD have the
> code in rc.subr (which is one of the unstated reasons that I closed the
> PR mentioned above).
> 
> Here is my perspective on the project:
> 1. Document the issue in
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html
> and give examples of how to do it properly.
> 2. Contact authors of existing ports that have this issue, and point
> them to the documentation. Offer help to fix it.
> 3. Take a page from pgolluci's book and file PRs with fixes for those
> who don't respond in a timely manner, then use the "maintainer timeout"
> facility to finish the fixes.
> 4. After 1., but perhaps in parallel with 2. and 3.; develop a patch for
> rc.subr to handle this, perhaps starting with the simple cases. The
> patch should include a signaling mechanism so that a port rc.d script
> can do something equivalent to:
> if [ $rc_subr_with_daemon_fix ]; then
>     do it the easy way
> else
>     do it the hard way
> fi
> 5. Once there is a new mechanism, repeat the steps in 1-3. :)
> 6. In 3-4 years, remove the crutches and mandate use of the new mechanism.
> 
> One could also argue that documentation and education are the right
> answers, and that patching rc.subr is not necessary. Personally I'm
> sympathetic to that line of reasoning, but I'd never want to discourage
> someone from improving rc.subr.
> 
> If you, or anyone are interested in pursuing any part of this then I'm
> happy to help review patches, make suggestions, etc. but I am not going
> to be able to own the project, I don't have the time. I would suggest
> that starting a new thread on -rc would be the right way to move forward.
> 
> 
> hth,
> 
> Doug
> 

Hi Doug,

Thank you for the useful background information and ideas about how to
proceed forward.  I'll put this task on my list (hah!) and see how much
progress I can make.

Cheers,
Greg
- --
Greg Larkin

http://www.FreeBSD.org/           - The Power To Serve
http://www.sourcehosting.net/     - Ready. Set. Code.
http://twitter.com/sourcehosting/ - Follow me, follow you
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFMRi4x0sRouByUApARAlFzAKCE6mkF0zqxwIdR5vRYjCGpub0pFgCeNBl/
SFS3p4Mkl754eone1H8NmL4=
=8kT2
-----END PGP SIGNATURE-----




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C462E31.4030801>