I can think of three off the top of my head that are roughly c1:
NFS: nfsd needs rpcbind to function (or at least function as intended).
Wireless routing: hostapd handles connections but needs a dhcp and/or
dns server running to be functional. Especially if you're doing dhcp
as a connection made without a functional dhcp server will never get
an IP address until it's recycled.
Anything that relies on dbus (though this is most likely any one of
the s cases).
None of these qualify for c2 though. The supports (rpcbind, dnsmasq,
dbus) won't cause problems if their primary goes down, and losing a
support is outside of the scope of these questions (it's
lame-to-catestrophic, but we expect our supervisor to bring it back
asap).
The c2 case that people get up in arms about is shutting down
networking before unmounting nfs shares. At least, I remember this
being a problem with systemd for a while, and that was because it
would hang a shutdown, not because it was leaving daemons in undesired
states. Besides that though, service shutdown should be reasonably
order agnostic: either you shut the primary down then the support; or
you shut down the support, the primary freaks out a bit, and then gets
shut down. Either way, your service is down.
Cheers!
On Mon, Nov 3, 2014 at 8:15 AM, Wayne Marshall <wcm_at_b0llix.net> wrote:
> Hi,
>
> Would someone kindly provide a real-world example of a service
> dependency? That is, some service "foo" that critically depends on
> another service "bar", and that satisfies either or both of the
> following conditions:
>
> c1: service "foo" MUST NOT be started, or be attempted to be started,
> until service "bar" is running, lest something undesirable happens.
>
> c2: service "foo" MUST be terminated whenever service "bar" stops
> running, lest something undesirable happens.
>
> To elaborate a little, the following scenarios are of *no* interest to
> this inquiry:
>
> s1: service "foo" fails immediately on startup if service "bar" is not
> available.
>
> s2: service "foo" terminates itself whenever service "bar" is not
> available.
>
> s3: service "foo" successfully starts and runs even if service "bar"
> is not running, and waits or queues or times-out or retries with
> diagnostics while "bar" is unavailable, but otherwise does nothing
> undesirable in the absence of "bar".
>
> Many thanks,
>
> Wayne
--
"If the doors of perception were cleansed every thing would appear to
man as it is, infinite. For man has closed himself up, till he sees
all things thru' narrow chinks of his cavern."
-- William Blake
Received on Mon Nov 03 2014 - 17:21:02 UTC