Gentoo Archives: gentoo-user

From: Willie Wong <wwong@××××××××××××××.edu>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to have init-scripts 'wait' for other servers
Date: Fri, 04 Sep 2009 04:14:22
Message-Id: 20090904092309.GA12383@princeton.edu
In Reply to: [gentoo-user] How to have init-scripts 'wait' for other servers by "J. Roeleveld"
1 On Fri, Sep 04, 2009 at 10:51:14AM +0200, Penguin Lover J. Roeleveld squawked:
2 > Does anyone know if an existing method to have init-scripts on server A wait
3 > for a service on server B to be started?
4
5 I have no idea if this would work or not. But have you tried writing a
6 init script that does nothing but polls for the service and only
7 exits when succeeds? Then you can edit the scripts for the dependent
8 services to require it to start after your polling script.
9
10 Something like: script /etc/init.d/foo polls tries for database
11 connection. Inside it is a time-delayed loop that tries until it
12 succeeds. Edit /etc/init.d/apache (assuming you are using it for your
13 webserver) to 'need foo'
14
15 Again, I am just throwing this out randomly. Let me know if it works
16 at all ;p
17
18 Best of luck,
19
20 W
21 --
22 Two college graduates are peeing in a bathroom.
23
24 The Harvard grad finishes, goes over and washes his hands very well using
25 lots of soap and water, and says "at Harvard, they teach us to be clean."
26
27 The Yale grad finishes, and washes his hands with a very small amount
28 of soap and water and says "at Yale they teach us to conserve resources."
29
30 Right then, a Princeton grad walks in, washes his hands thoroughly,
31 and goes to the urinal, saying "At Princeton, they teach us to wash
32 our hands before handling a sacred object."
33 Sortir en Pantoufles: up 1001 days, 8:06

Replies

Subject Author
Re: [gentoo-user] How to have init-scripts 'wait' for other servers "J. Roeleveld" <joost@××××××××.org>