From owner-freebsd-rc@FreeBSD.ORG Sun Mar 11 07:02:40 2012 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 57750106564A for ; Sun, 11 Mar 2012 07:02:40 +0000 (UTC) (envelope-from bsd-src@helfman.org) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0F57D8FC19 for ; Sun, 11 Mar 2012 07:02:39 +0000 (UTC) Received: by vcmm1 with SMTP id m1so3705995vcm.13 for ; Sat, 10 Mar 2012 23:02:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=B14tS1imqG4BG0KICjRNewWp+YG215tNB2Mv00acrG8=; b=dCnqM+I7ve426UhGxq1zzphcrKr6DOc8xHgTtFHTy7fdv8cf6lPUTicY+s/YTf95R4 mFl88QrcRc88BAddSmpSAHOXlqxNJIarj7RCmnp5SEXdWM6TnGg7Kjpo0KoTXCpvHlfU TWXnRhwaT8ElSVTGtGaY5GrxgY8DdBYCUKfV3/cA/+CTrLSsQg/P/oaYD7nofhjueGHN eLNUtV1ZZr+gapAosLJ2HtB6Jb9kTSOoo8zLOD3XphdrmHxnKeFW1mXZ0GIq05ZgOx5Y ZtJphbqFLzyWt5Qq7peE9iJeess7RI3BnnmzS6oYnDRa+k+Xcta+5yeAXRGtmku40urD tqmg== MIME-Version: 1.0 Received: by 10.52.27.10 with SMTP id p10mr11895929vdg.16.1331449359542; Sat, 10 Mar 2012 23:02:39 -0800 (PST) Sender: bsd-src@helfman.org Received: by 10.52.162.103 with HTTP; Sat, 10 Mar 2012 23:02:39 -0800 (PST) In-Reply-To: <86aa3sdqu9.fsf@red.stonehenge.com> References: <86r4x4dv1r.fsf@red.stonehenge.com> <4F57D10D.1030501@FreeBSD.org> <86aa3sdqu9.fsf@red.stonehenge.com> Date: Sat, 10 Mar 2012 23:02:39 -0800 X-Google-Sender-Auth: uQeKDVHHht2FskubqCnSSSMCYQU Message-ID: From: Jason Helfman To: "Randal L. Schwartz" X-Gm-Message-State: ALoCoQl0A8MSQ0kyxY8IURd5xEdFv9VT0HXPerBeDzSPa1MgUh5Bl+PplFAGQsqMzUPZbC+6HgGV Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: rc@freebsd.org, Matthew Seaman 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: Sun, 11 Mar 2012 07:02:40 -0000 On Wed, Mar 7, 2012 at 1:49 PM, Randal L. Schwartz wrote: > >>>>> "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. > > This is starting to appear more and more like a bug in pgpool rc script. When are you going to run pgpool without a pgsql server? Why not have a dependeny on pgsq on pgpooll, and require it in rc? Am I off-base, or would there be instances where you would run pgpool outside of an environment running pgsql-server? thanks -jgh