Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Cross system dependencies
Date: Sun, 29 Jun 2014 06:57:09
Message-Id: 2656176.t9vS7AZdKZ@andromeda
In Reply to: Re: [gentoo-user] Cross system dependencies by thegeezer
1 On Saturday, June 28, 2014 09:23:17 PM thegeezer wrote:
2 > On 06/28/2014 07:06 PM, J. Roeleveld wrote:
3 > > On Saturday, June 28, 2014 01:39:41 PM Neil Bothwick wrote:
4 > >> On Sat, 28 Jun 2014 11:36:11 +0200, J. Roeleveld wrote:
5 > >>> I need a way to add dependencies to services which are provided by
6 > >>> different servers. For instance, my mail server uses DNS to locate my
7 > >>> LDAP server which contains the mail aliases. All these are running on
8 > >>> different machines. Currently, I manually ensure these are all started
9 > >>> in the correct sequence, I would like to automate this to the point
10 > >>> where I can start all 3 servers at the same time and have the different
11 > >>> services wait for the dependency services to be available even though
12 > >>> they are on different systems.
13 > >>>
14 > >>> All the dependency systems in the init-systems I could find are all
15 > >>> based on dependencies on the same server. Does anyone know of something
16 > >>> that can already provide this type of dependencies? Or do I need to
17 > >>> write something myself?
18 > >>
19 > >> With systemd you can add ExecStartPre=/some/script to the service's unit
20 > >> file where /some/script waits for the remote services to become
21 > >> available,
22 > >> and possibly return an error if the service does not become available
23 > >> within a set time.
24 > >
25 > > That method works for any init-system and writing a script to check and if
26 > > necessary fail is my temporary fall-back plan. I was actually hoping for a
27 > > method that can be used to monitor availability and, if necessary, stop
28 > > services when the dependencies disappear.
29 > >
30 > > --
31 > > Joost
32 >
33 > the difficulty is in identifying failed services.
34 > local network issue / load issue could mean your services start bouncing.
35 > the best way is to have redundancy so it doesn't matter as much
36
37 I know that. A proper system for this would have a configurable amount of
38 retries with a wait-time in between.
39
40 > having said all of that::
41 >
42 > systemd will start servers and buffer network activity - how this works
43 > for non local services would be interesting to see.
44
45 It would, but I am not going to migrate my servers to something like systemd
46 without a clear and proven advantage. For me, that currently does not exist.
47 It also would not work as not all the software I run will happily wait while
48 the rest of the stack starts.
49 I would end up in a bigger mess thanks to timeout issues during startup.
50
51 > with openrc :
52 > you could on the DNS server have a service which is just a batch script
53 > that uses watches for pid / program path in "ps" which outputs ACK or
54 > NAK to a file in an NFS share say /nfs/monitoring/dns
55
56 Yes, but in order to access the NFS share, I need DNS to be running. Chicken-
57 egg problem.
58
59 > then on the mail server you could have a service that polls
60 > /nfs/monitoring/dns for NAK or ACK
61 > you can then choose to have this service directly start your dependent
62 > services, or if you adjust /etc/init.d/postfix to have depends =
63 > "mymonitorDNS" which is an empty shell of a service. your watchdog
64 > service could stop / start the empty shell of a script mymonitorDNS, and
65 > then postfix depends on mymonitorDNS
66 > this would save you from "i've just stopped the mail server for
67 > maintenance and my watchdogservice has just restarted it due to a
68 > NAK>ACK event"
69
70 That is the problem I have with these watchdog services. During boot, I want
71 it to wait. But it needs to understand not to start a service when I stopped
72 it during runtime.
73 Otherwise it could prevent a clean shutdown as well...
74
75 > or...
76 > you could have a central master machine which has it's own services,
77 > watchdog and monitor... i.e. /etc/init.d/thepostfixserver start /
78 > depends on thednsserver which just runs
79 > # ssh postfixserver '/etc/init.d/postfix start'
80 >
81 > or...
82 > puppet and it's kin
83
84 Last time I looked at puppet, it seemed too complex for what I need.
85 I will recheck it again.
86
87 Thanks,
88
89 Joost

Replies

Subject Author
Re: [gentoo-user] Cross system dependencies Neil Bothwick <neil@××××××××××.uk>