On Thu, 17.03.11 14:32, Andrey Borzenkov (arvidj...@mail.ru) wrote:

> > Ah, I missed the "target units" part, but even then
> > "Requires=network.target + After=network.target" is a common
> > enough pattern for services that need network to be up at startup and
> > After= line is present in each one of them:
> >
> 
> Dependencies are added to target for units that it pulls. Not other way round.
> 
> >  /lib/systemd/system/noip.service:Requires=network.target
> >  /lib/systemd/system/dnscache.service:Requires=network.target
> >  /lib/systemd/system/tinydns.service:Requires=network.target
> >  /lib/systemd/system/remote-fs.target:Requires=network.target
> >  /lib/systemd/system/ziproxy.service:Requires=network.target
> >  /lib/systemd/system/ejabberd.service:Requires=network.target
> >  /lib/systemd/system/dhcpd.service:Requires=network.target
> 
> I tentatively think that these should be either After or Requisite. Do
> you really want to start network every time one of those services gets
> started (assuming there were reasons to have network stopped at this
> moment)?

Yes, I agree fully with Andrey. For two reasons:

A) I think it is important to implement lose coupling, i.e. ejabber
works fine without network, hence a Requires= is not really necessary.

and

B) Whether a service is enabled or not should be a decision of the admin
he can control with "systemctl enable" and "systemctl". When you use
Wants/Requires too often you bit by bit take this away from the admin,
since simply enabling ejabber might also enable the network in your
case, which is not necessarily what the admin wants.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to