From owner-freebsd-rc@FreeBSD.ORG Tue Jul 20 23:16:10 2010 Return-Path: Delivered-To: rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CA841065670; Tue, 20 Jul 2010 23:16:10 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id DA89C8FC14; Tue, 20 Jul 2010 23:16:09 +0000 (UTC) Received: from 68-189-245-235.dhcp.oxfr.ma.charter.com ([68.189.245.235] helo=cube.entropy.prv) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1ObM2d-000CAk-1m; Tue, 20 Jul 2010 19:16:08 -0400 Received: from [127.0.0.1] (fireball.entropy.prv [192.168.1.12]) by cube.entropy.prv (Postfix) with ESMTP id 6D19442BC27E; Tue, 20 Jul 2010 19:16:03 -0400 (EDT) Message-ID: <4C462E31.4030801@FreeBSD.org> Date: Tue, 20 Jul 2010 19:16:01 -0400 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Doug Barton References: <20100717105658.GV1742@hoeg.nl> <4C461CA5.2040307@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=1C940290 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) Cc: ports@FreeBSD.org, Ed Schouten , rc@FreeBSD.org Subject: Re: General note on rc scripts and daemonizing X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 23:16:10 -0000 -----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-----