Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1046297 - bg (background) NFS mounts doesn't work as expected
Summary: bg (background) NFS mounts doesn't work as expected
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-24 11:42 UTC by Tore Anderson
Modified: 2014-06-20 00:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-20 00:17:40 UTC
Type: Bug


Attachments (Terms of Use)

Description Tore Anderson 2013-12-24 11:42:49 UTC
Description of problem:

A NFS mount declared as "bg" in /etc/fstab doesn't work as expected. It ends up blocking the bootup process.

Version-Release number of selected component (if applicable):

systemd-208-9.fc20.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Add a NFS mount of an unreachable NFS server in /etc/fstab, using "defaults,bg" as the mount options
2. Reboot

Actual results:

The reboot stalls at the mount job, waiting for a timeout.

Expected results:

The mount process should be backgrounded and the boot process continue immediately.

Additional info:

nfs(5) describes the bg mount option:

                      If  the  bg  option  is  specified, a timeout or failure
                      causes the mount(8) command to fork a child  which  con‐
                      tinues to attempt to mount the export.  The parent imme‐
                      diately returns with a zero exit code.  This is known as
                      a "background" mount.

The fstab line that triggers the bug on my system is:

192.168.0.2:/fud                          /fud                    nfs     defaults,bg     0 0

tore@sloth:~$ systemctl status fud.mount
fud.mount - /fud
   Loaded: loaded (/etc/fstab)
   Active: failed (Result: timeout) since ti. 2013-12-24 12:35:17 CET; 21s ago
    Where: /fud
     What: 192.168.0.2:/fud
  Process: 1132 ExecMount=/bin/mount 192.168.0.2:/fud /fud -t nfs -o defaults,bg (code=killed, signal=TERM)

des. 24 12:16:06 sloth.fud.no systemd[1]: fud.mount mounting timed out. Stopping.
des. 24 12:16:06 sloth.fud.no systemd[1]: Mounted /fud.
des. 24 12:35:17 sloth.fud.no systemd[1]: Unit fud.mount entered failed state.

As you can see from the timestamps above, the start job stalled for 20 seconds. This stalled the entire bootup process, too.

Comment 1 Lennart Poettering 2014-06-20 00:17:40 UTC
Well, systemd watches the kernel for the mount to show up, and right-fully so as it shouldn't proceed with other mounts that are inside of this one before it actually was mouinted in the kernel. If you don't want to wait for the thing at boot, use "nofail".


Note You need to log in before you can comment on or make changes to this bug.