[systemd-devel] network-online.target and manual mounts

Andrey Borzenkov arvidjaar at gmail.com
Wed Jan 1 13:13:36 PST 2014


В Ср, 01/01/2014 в 15:00 -0500, Dave Reisner пишет:
> On Wed, Jan 01, 2014 at 11:43:15PM +0400, Andrey Borzenkov wrote:
> > systemd.special(7) suggests that network-online.target should be pulled
> > in by consumer. Unfortunately, that means that when booting without
> > active consumer (let's say no NFS mounts in fstab) network-online.target
> > is not started at all. If NFS is mounted manually later, no
> > synchronization point exists on shutdown, so network may be stopped
> > before NFS is unmounted. This leads to prolonged timeout.
> > 
> > Is there any mechanism to start it when NFS (or other network) mount
> > appears? The very existence of network mount could be considered as
> > indication that network *is* online?
> 
> I think tihs is a post-v208 change, but if you manually mount a network
> share manually after booting, network-online.target is pulled in as
> Wants= and After=. This should make for correct ordering on shutdown.
> 
> # mount.cifs //10.0.2.1/pkgs pkg -o defaults,guest,rw
> # systemctl show -p After -p Wants $PWD/pkg
> Wants=network-online.target system.slice
> After=systemd-journald.socket remote-fs-pre.target network.target network-online.target system.slice -.mount
> 

Yes, units automatically created from existing mounts do get Wants, but
as they are never activated via systemd, these Wants lines never gets
executed.

Check "systemctl status network-online.target".

> d





More information about the systemd-devel mailing list