snapd 2.37.4+18.04 doesn't detect automount/autofs based NFS filesystems

Bug #1821193 reported by Gabriel Devenyi
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Medium
Zygmunt Krynicki

Bug Description

The snapd daemon attempts to determine if NFS filesystems are present using /etc/fstab and the mount list, according to the feature commit added here https://github.com/snapcore/snapd/pull/3958

Unfortunately, in many real-world network login systems, network filesystems are managed by autofs/automount, so that in the case of networking being stalled or servers being down, the boot continues and the local system/users can still be used.

A small example:
/etc/auto.master
---
/home/remoteuser /etc/auto.home
---
/etc/auto.home
---
* -fstype=nfs4,v4.1,rw,nodev,hard,intr,async,noatime,nodiratime,noauto,acl,sloppy,tcp neuralabcss01:/volume1/remotehomes/&
---

What this looks like in mount:
---
/etc/auto.home on /home/remoteuser type autofs (rw,relatime,fd=6,pgrp=1986,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=36015)
---

Since no NFS filesystem is mounted, snapd starts up and does not enable NFS support:
---
> journalctl -u snapd
Mar 21 10:30:15 neuralabcws01 systemd[1]: Starting Snappy daemon...
Mar 21 10:30:15 neuralabcws01 snapd[1052]: AppArmor status: apparmor is enabled and all features are available
Mar 21 10:30:19 neuralabcws01 snapd[1052]: daemon.go:379: started snapd/2.37.4+18.04 (series 16; classic) neon/18.04 (amd64) linux/4.15.0-46-generic.
Mar 21 10:30:39 neuralabcws01 systemd[1]: Started Snappy daemon.
---

If I then login an NFS user, and restart snapd
---
> journalctl -u snapd
Mar 21 10:33:39 neuralabcws01 systemd[1]: Starting Snappy daemon...
Mar 21 10:33:39 neuralabcws01 snapd[3446]: AppArmor status: apparmor is enabled and all features are available
Mar 21 10:33:39 neuralabcws01 snapd[3446]: backend.go:113: snapd enabled NFS support, additional implicit network permissions granted
Mar 21 10:33:42 neuralabcws01 snapd[3446]: daemon.go:379: started snapd/2.37.4+18.04 (series 16; classic) neon/18.04 (amd64) linux/4.15.0-46-generic.
Mar 21 10:33:43 neuralabcws01 systemd[1]: Started Snappy daemon.
---

Revision history for this message
Gabriel Devenyi (ace-staticwave) wrote :

Autodetection of this would be nice, but a workaround that I can manually enable cleanly using my ansible provisioning would be fine as well, right now, based on https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1662552 I can fix this, but I expect this fix to be very fragile as I need to insert lines into config files that I suspect will be modified by future snapd upgrade.

A config.d directory where I can drop a config file to append permissions would be ideal.

Zygmunt Krynicki (zyga)
Changed in snapd:
status: New → Confirmed
assignee: nobody → Zygmunt Krynicki (zyga)
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.