[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Custom Reload command/signal in upstart



On Sat, Jun 01, 2013 at 12:24:02PM +0200, Vincent Bernat wrote:
> It seems that now, we can do this, but the cookbook also says this is
> not here yet:
> 
>   start on started network-services
> 
> I don't know how systemd behaves in this way (so this is not something
> to hold against upstart), but there are so many daemons that need to be
> started after the network has been configured that it should be easy to
> do this. For example, most daemons binding to a specific address needs
> to be started after the address has been configured.
Hi,
to answer the systemd question: you can order stuff After=network.target,
which basically means that network interfaces will be up, which is
deterministic and cheap, or After=network-online.target. This second
target is usually more expensive, meaning that it can take lots of time to
become satisfied. The problem with full network connectivity is that it's
hard to verify and transient. Nevertheless,
'systemctl enable NetworkManager-wait-online' makes network-online.target
wait until NetworkManager signals that it has established a connection,
and services ordered After=network-online.target will be started after
that.

See http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
and http://www.freedesktop.org/software/systemd/man/systemd.special.html#network-online.target for longer explanations.

Zbyszek

PS. One could also add custom conditions, like After=my-router-is-pingable.target,
and then make the my-router-is-pingable.target depend on a service
which pings the router and waits until the first reply. Haven't seen
anybody do that though, since it is better to simply make services
handle transient network conditions.


Reply to: