1 |
On Saturday, June 28, 2014 01:39:41 PM Neil Bothwick wrote: |
2 |
> On Sat, 28 Jun 2014 11:36:11 +0200, J. Roeleveld wrote: |
3 |
> > I need a way to add dependencies to services which are provided by |
4 |
> > different servers. For instance, my mail server uses DNS to locate my |
5 |
> > LDAP server which contains the mail aliases. All these are running on |
6 |
> > different machines. Currently, I manually ensure these are all started |
7 |
> > in the correct sequence, I would like to automate this to the point |
8 |
> > where I can start all 3 servers at the same time and have the different |
9 |
> > services wait for the dependency services to be available even though |
10 |
> > they are on different systems. |
11 |
> > |
12 |
> > All the dependency systems in the init-systems I could find are all |
13 |
> > based on dependencies on the same server. Does anyone know of something |
14 |
> > that can already provide this type of dependencies? Or do I need to |
15 |
> > write something myself? |
16 |
> |
17 |
> With systemd you can add ExecStartPre=/some/script to the service's unit |
18 |
> file where /some/script waits for the remote services to become available, |
19 |
> and possibly return an error if the service does not become available |
20 |
> within a set time. |
21 |
|
22 |
That method works for any init-system and writing a script to check and if |
23 |
necessary fail is my temporary fall-back plan. I was actually hoping for a |
24 |
method that can be used to monitor availability and, if necessary, stop |
25 |
services when the dependencies disappear. |
26 |
|
27 |
-- |
28 |
Joost |