Discussion:
Services with DefaultDependencies=no
Add Reply
Leonid Isaev via arch-general
2018-08-27 12:45:25 UTC
Reply
Permalink
Raw Message
Hi,

While going over .service files on my system, I noticed that quite a
few of them, not belonging to systemd package, contain DefaultDependencies=no
(DD=no). This is understandable (perhaps) for programs like systemd-journald,
but what about normal daemons, like rpcbind, haveged and rpc-nfsd? I thought
that setting DD=no is kind of a hack needed only for special services (e.g.
called from fstab via x-systemd.requires=). Or am I missing something?

Thanks,
L.
--
Leonid Isaev
Eli Schwartz via arch-general
2018-08-27 16:51:13 UTC
Reply
Permalink
Raw Message
Post by Leonid Isaev via arch-general
Hi,
While going over .service files on my system, I noticed that quite a
few of them, not belonging to systemd package, contain DefaultDependencies=no
(DD=no). This is understandable (perhaps) for programs like systemd-journald,
but what about normal daemons, like rpcbind, haveged and rpc-nfsd? I thought
that setting DD=no is kind of a hack needed only for special services (e.g.
called from fstab via x-systemd.requires=). Or am I missing something?
DefaultDependencies=false means it won't get "ensure that the service is
started only after basic system initialization is completed and is
properly terminated on system shutdown." (from the systemd.unit(5) man
page).

Seems like a reasonable thing to want to avoid for programs that are
meant to be started as part of initializing the system.

e.g. you might want RPC daemons running as soon as possible. You most
likely do want haveged running as soon as possible.
--
Eli Schwartz
Bug Wrangler and Trusted User
Leonid Isaev via arch-general
2018-08-27 17:52:50 UTC
Reply
Permalink
Raw Message
Post by Eli Schwartz via arch-general
Post by Leonid Isaev via arch-general
Hi,
While going over .service files on my system, I noticed that quite a
few of them, not belonging to systemd package, contain DefaultDependencies=no
(DD=no). This is understandable (perhaps) for programs like systemd-journald,
but what about normal daemons, like rpcbind, haveged and rpc-nfsd? I thought
that setting DD=no is kind of a hack needed only for special services (e.g.
called from fstab via x-systemd.requires=). Or am I missing something?
DefaultDependencies=false means it won't get "ensure that the service is
started only after basic system initialization is completed and is
properly terminated on system shutdown." (from the systemd.unit(5) man
page).
Yeah, systemd.service manpage is more relevant here. Because it says that
daemons with DD=no are also not subject to the normal shutdown logic...
Post by Eli Schwartz via arch-general
Seems like a reasonable thing to want to avoid for programs that are
meant to be started as part of initializing the system.
Initialization or early boot?
Post by Eli Schwartz via arch-general
e.g. you might want RPC daemons running as soon as possible. You most
likely do want haveged running as soon as possible.
Actually, digging into nfs-utils I understand why devs did it (for NFS-mounted
/var). But they also were careful to specify dependencies on services that are
pulled as a part of basic and sysinit targets. I disagree with that decision
because I might want to bring firewall (iptables.service obeys the normal DD
logic) before NFS/rpcbind is started (I do it for port-forwarding RPCbind and
ypserv calls into a container).

But I'm really not sure why you'd need haveged in early boot (as opposed to
inird), nor that it doesn't require any of the early-boot services...

But thx anyway,
--
Leonid Isaev
Loading...