From owner-freebsd-rc@FreeBSD.ORG Wed Mar 7 21:49:45 2012 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 3A9D8106566B for ; Wed, 7 Mar 2012 21:49:45 +0000 (UTC) (envelope-from merlyn@stonehenge.com) Received: from mail.mroute.net (lax-gw06.mailroute.net [199.89.0.106]) by mx1.freebsd.org (Postfix) with ESMTP id 192A28FC0C for ; Wed, 7 Mar 2012 21:49:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by lax-gw06.mroute.net (Postfix) with ESMTP id CE0BBCBD7; Wed, 7 Mar 2012 21:49:34 +0000 (GMT) X-Virus-Scanned: by MailRoute Received: from red.stonehenge.com (red.stonehenge.com [208.79.95.2]) by lax-gw06.mroute.net (Postfix) with ESMTP id B6F8DCBC1; Wed, 7 Mar 2012 21:49:18 +0000 (GMT) Received: by red.stonehenge.com (Postfix, from userid 1001) id A37CE1828; Wed, 7 Mar 2012 13:49:18 -0800 (PST) From: merlyn@stonehenge.com (Randal L. Schwartz) To: Matthew Seaman References: <86r4x4dv1r.fsf@red.stonehenge.com> <4F57D10D.1030501@FreeBSD.org> x-mayan-date: Long count = 12.19.19.3.11; tzolkin = 1 Chuen; haab = 19 Kayab Date: Wed, 07 Mar 2012 13:49:18 -0800 In-Reply-To: <4F57D10D.1030501@FreeBSD.org> (Matthew Seaman's message of "Wed, 07 Mar 2012 21:20:13 +0000") Message-ID: <86aa3sdqu9.fsf@red.stonehenge.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: rc@FreeBSD.org Subject: Re: need a shim between postgresql and pgpool startup X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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: Wed, 07 Mar 2012 21:49:45 -0000 >>>>> "Matthew" == Matthew Seaman writes: Matthew> For extra credit, write a small routine that attempts to log into Matthew> postgres (or otherwise establish that postgres is up and doing) and Matthew> loops until it succeeds or it has reached a certain maximum number of Matthew> tries. Make this a function called start_precommand() and use the Matthew> run_rc_command facility so it only runs if the script is given some form Matthew> of start argument. Docco on rc script functionality is in rc.subr(8) Matthew> Also look at: Matthew> http://www.freebsd.org/doc/en/books/porters-handbook/rc-scripts.html Yeah, I'd been staring at those for a few hours, even staring at the source code of rc.subr to sort this out. Thanks for the drop-in answer. I'll see if it does the job on the next reboot. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.posterous.com/ for Smalltalk discussion