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 ) id 1MjQdr-0001Jm-Ot for garchives@archives.gentoo.org; Fri, 04 Sep 2009 04:43:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 709A3E06C1; Fri, 4 Sep 2009 09:51:51 +0000 (UTC) Received: from smtpq3.tb.mail.iss.as9143.net (smtpq3.tb.mail.iss.as9143.net [212.54.42.166]) by pigeon.gentoo.org (Postfix) with ESMTP id 2A39AE06C1 for ; Fri, 4 Sep 2009 09:51:51 +0000 (UTC) Received: from [212.54.42.134] (helo=smtp3.tb.mail.iss.as9143.net) by smtpq3.tb.mail.iss.as9143.net with esmtp (Exim 4.69) (envelope-from ) id 1MjVSQ-0005OM-D3 for gentoo-user@lists.gentoo.org; Fri, 04 Sep 2009 11:51:50 +0200 Received: from 5353258a.cable.casema.nl ([83.83.37.138] helo=data.hosts.antarean.org) by smtp3.tb.mail.iss.as9143.net with esmtp (Exim 4.69) (envelope-from ) id 1MjVSL-00083c-Jw for gentoo-user@lists.gentoo.org; Fri, 04 Sep 2009 11:51:45 +0200 Received: from localhost (localhost [127.0.0.1]) by data.hosts.antarean.org (Postfix) with ESMTP id 30E7628C08 for ; Fri, 4 Sep 2009 11:51:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at antarean.org Received: from data.hosts.antarean.org ([127.0.0.1]) by localhost (data.hosts.antarean.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uKHKhmgE0tcP for ; Fri, 4 Sep 2009 11:51:45 +0200 (CEST) Received: from eve.localnet (eve.hosts.antarean.org [10.1.5.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by data.hosts.antarean.org (Postfix) with ESMTPS id 0E92923AC0 for ; Fri, 4 Sep 2009 11:51:45 +0200 (CEST) From: "J. Roeleveld" To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] How to have init-scripts 'wait' for other servers Date: Fri, 4 Sep 2009 11:51:44 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.27-gentoo-r7; KDE/4.2.4; x86_64; ; ) References: <200909041051.14640.joost@antarean.org> <20090904092309.GA12383@princeton.edu> In-Reply-To: <20090904092309.GA12383@princeton.edu> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909041151.44493.joost@antarean.org> X-ZiggoSMTP-MailScanner-Information: Please contact the ISP for more information X-ZiggoSMTP-MailScanner-ID: 1MjVSL-00083c-Jw X-ZiggoSMTP-MailScanner: Found to be clean X-ZiggoSMTP-MailScanner-SpamCheck: geen spam, SpamAssassin (niet cached, score=-2.599, vereist 5, autolearn=not spam, BAYES_00 -2.60) X-ZiggoSMTP-MailScanner-From: joost@antarean.org X-Spam-Status: No X-Archives-Salt: bbf3b30a-09c7-4562-9cd4-3696a81d9f07 X-Archives-Hash: 3c67441cd1a939cf4ba165a9abbead64 On Friday 04 September 2009 11:23:09 Willie Wong wrote: > 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. I have been thinking of something similar, but before starting to write this myself, I wanted to double check if anyone has a better idea and/or already knows of a set of scripts/tools that already implement this. > 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' Or, obviously, fails if it doesn't come up within a certain (configurable) time. > Again, I am just throwing this out randomly. Let me know if it works > at all ;p If there is no existing set of scripts, I will share whatever I come up with. > Best of luck, Thanks, Joost