[systemd-devel] [PATCH 2/7] mount: don't pull in network.target, just order after it
Lennart Poettering
lennart at poettering.net
Tue Sep 10 09:40:59 PDT 2013
On Fri, 23.08.13 15:09, Tom Gundersen (teg at jklm.no) wrote:
> ---
> src/core/mount.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/core/mount.c b/src/core/mount.c
> index c7d29b0..7838e60 100644
> --- a/src/core/mount.c
> +++ b/src/core/mount.c
> @@ -476,7 +476,7 @@ static int mount_add_default_dependencies(Mount *m) {
> }
>
> if (online) {
> - r = unit_add_two_dependencies_by_name(UNIT(m), UNIT_WANTS, UNIT_AFTER, online, NULL, true);
> + r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, online, NULL, true);
> if (r < 0)
> return r;
> }
Hmm, no. network-online.target is supposed to contain a unit like
NetworkManager-wait-online.service, i.e. awful scripts that just wait,
that should be kept out of the boot if possible, and should only be
pulled in if some code really needs it, like NFS shares do, for example.
See systemd.special(7) for an explanation:
<snip>
Units that strictly require a configured network connection
should pull in network-online.target (via a Wants= type dependency) and
order themselves after it. This
target unit is intended to pull in a service that delays
further execution until the network is sufficiently set
up. What precisely this requires is left to the
implementation of the network managing service.
Note the distinction between this unit and
network.target. This unit is an active unit (i.e. pulled in
by the consumer rather than the provider of this
functionality) and pulls in a service which possibly adds
substantial delays to further execution. In contrast,
network.target is a passive unit (i.e. pulled in by
the provider of the functionality, rather than the consumer)
that usually does not delay execution much. Usually,
network.target is part of the boot of most
systems, while network-online.target is not, except when at
least one unit requires it. Also see Running Services After
the Network is up[1] for more information.
All mount units for remote network file systems automatically
pull in this unit, and order themselves after it. Note that
networking daemons that simply provide
functionality to other hosts generally don't need to pull
this in.
</snip>
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list