From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-99725-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1MjQBq-0005sL-Eb
	for garchives@archives.gentoo.org; Fri, 04 Sep 2009 04:14:22 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1A6CEE087C;
	Fri,  4 Sep 2009 09:22:54 +0000 (UTC)
Received: from Princeton.EDU (postoffice05.Princeton.EDU [128.112.133.189])
	by pigeon.gentoo.org (Postfix) with ESMTP id EE015E087C
	for <gentoo-user@lists.gentoo.org>; Fri,  4 Sep 2009 09:22:53 +0000 (UTC)
Received: from smtpserver2.Princeton.EDU (smtpserver2.Princeton.EDU [128.112.129.148])
	by Princeton.EDU (8.13.8/8.13.8) with ESMTP id n849MrXD023120
	for <gentoo-user@lists.gentoo.org>; Fri, 4 Sep 2009 05:22:53 -0400 (EDT)
Received: from sep.dynalias.net (fez.Princeton.EDU [128.112.129.190])
	(authenticated bits=0)
	by smtpserver2.Princeton.EDU (8.12.9/8.12.9) with ESMTP id n849MqGs009955
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT)
	for <gentoo-user@lists.gentoo.org>; Fri, 4 Sep 2009 05:22:53 -0400 (EDT)
Received: by sep.dynalias.net (Postfix, from userid 1001)
	id CB90093620; Fri,  4 Sep 2009 05:23:09 -0400 (EDT)
Date: Fri, 4 Sep 2009 05:23:09 -0400
From: Willie Wong <wwong@math.princeton.edu>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] How to have init-scripts 'wait' for other servers
Message-ID: <20090904092309.GA12383@princeton.edu>
Mail-Followup-To: gentoo-user@lists.gentoo.org
References: <200909041051.14640.joost@antarean.org>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200909041051.14640.joost@antarean.org>
User-Agent: Mutt/1.5.16 (2007-06-09)
X-Archives-Salt: 553d2a06-c73f-4d71-a5fe-d970a43f4b99
X-Archives-Hash: a96f5ce94aed3f4b9a0cf87a836f8471

On Fri, Sep 04, 2009 at 10:51:14AM +0200, Penguin Lover J. Roeleveld squawked:
> Does anyone know if an existing method to have init-scripts on server A wait 
> for a service on server B to be started?

I have no idea if this would work or not. But have you tried writing a
init script that does nothing but polls for the service and only
exits when succeeds? Then you can edit the scripts for the dependent
services to require it to start after your polling script. 

Something like: script /etc/init.d/foo polls tries for database
connection. Inside it is a time-delayed loop that tries until it
succeeds. Edit /etc/init.d/apache (assuming you are using it for your
webserver) to 'need foo'

Again, I am just throwing this out randomly. Let me know if it works
at all ;p

Best of luck, 

W
-- 
Two college graduates are peeing in a bathroom. 

The Harvard grad finishes, goes over and washes his hands very well using 
lots of soap and water, and says "at Harvard, they teach us to be clean."

The Yale grad finishes, and washes his hands with a very small amount
of soap and water and says "at Yale they teach us to conserve resources."

Right then, a Princeton grad walks in, washes his hands thoroughly,
and goes to the urinal, saying "At Princeton, they teach us to wash
our hands before handling a sacred object."
Sortir en Pantoufles: up 1001 days,  8:06