fstab-generator: fix automount option and don't start associated mount unit at boot
authorFranck Bui <fbui@suse.com>
Tue, 1 Dec 2015 17:01:44 +0000 (18:01 +0100)
committerFranck Bui <fbui@suse.com>
Fri, 4 Mar 2016 21:09:08 +0000 (22:09 +0100)
commit2b14df4a9ae92623b584e61db6b5b37accd832c1
treecfbd33f9207fbeb27af8f9fc854d883a6c1a7726
parent9f0cd100d0dbc7c9b55e99bacb4034402a60b389
fstab-generator: fix automount option and don't start associated mount unit at boot

Without this patch applied the mount unit with 'automount' option was still
pulled by local-fs.target and thus was activated during the boot process which
defeats the purpose of the 'automount' option:

   $ grep /mnt /etc/fstab
   /dev/vdb1 /mnt ext2 defaults,x-systemd.automount 0 0

   $ reboot
   ...

   $ mount | grep mnt
   systemd-1 on /mnt type autofs (rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
   /dev/vdb1 on /mnt type ext2 (rw,relatime)

   $ systemctl status mnt.mount | grep Active
      Active: active (mounted) since Thu 2016-03-03 21:36:22 CET; 42s ago

With the patch applied:

   $ reboot
   ...

   $ mount | grep mnt
   systemd-1 on /mnt type autofs (rw,relatime,fd=22,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)

   $ systemctl status mnt.mount | grep Active
      Active: inactive (dead)

   $ ls /mnt
   lost+found

   $ systemctl status mnt.mount | grep Active
      Active: active (mounted) since Thu 2016-03-03 21:47:32 CET; 4s ago
src/core/mount.c
src/fstab-generator/fstab-generator.c