Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Mar 2012 13:49:18 -0800
From:      merlyn@stonehenge.com (Randal L. Schwartz)
To:        Matthew Seaman <matthew@FreeBSD.org>
Cc:        rc@FreeBSD.org
Subject:   Re: need a shim between postgresql and pgpool startup
Message-ID:  <86aa3sdqu9.fsf@red.stonehenge.com>
In-Reply-To: <4F57D10D.1030501@FreeBSD.org> (Matthew Seaman's message of "Wed,  07 Mar 2012 21:20:13 %2B0000")
References:  <86r4x4dv1r.fsf@red.stonehenge.com> <4F57D10D.1030501@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "Matthew" == Matthew Seaman <matthew@FreeBSD.org> 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
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>;
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86aa3sdqu9.fsf>