systemd network-online.target question

Lennart Poettering mzerqung at 0pointer.de
Tue Jul 16 15:24:03 UTC 2013


On Tue, 16.07.13 11:12, Kaleb KEITHLEY (kkeithle at redhat.com) wrote:

> 
> I need glusterd to start before any _netdev mounts (NFS or
> glusterfs) take place.
> 
> reading the system.special man page it talks about ...pulling in
> network-online.target and order themselves after it.
> 
> Would adding a Before=network-online.target to the glusterd.service
> be the right thing to do or is there a better solution?  (It already
> has After=network.target rpcbind.service)

All network mounts configured in fstab will pull in
network-online.target, and are ordered after it.

If you want your service to be started only if there's at least one
remote fs configured, then add WantedBy=network-online.target to your
[Install] section, and Before=network-online.target to your [Unit]
section.

If you want your service to start on *all* boots, regardless whether
there is any remote fs configured in fstan or not -- but if there's a
remote fs configured then before that, then only use
Before=network-online.target in your [Unit] section. (And use
WantedBy=multi-user.target in [Install] as you would for any other
normal service).

Hope that makes sense?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the devel mailing list