mount.mounted creating duplicate entries.

30 views
Skip to first unread message

Mesa

unread,
Aug 4, 2017, 5:15:55 PM8/4/17
to Salt-users
Trying to understand why mount.mounted created a duplicate fstab entry if the existing entry doesn't have the dump pass_num fields listed (0 0)

BEFORE
#grep test /etc/fstab
someshare:/test          /mnt1 nfs     bg,hard,vers=3,intr,timeo=600,tcp       0 0
someshare:/test          /mnt2 nfs     soft       0 0
someshare:/test          /mnt3 nfs     bg,hard,vers=3,intr,timeo=600,tcp      

run Salt NFS state. state basically does some checks to make sure certain options are enabled and also retains any existing options outside of those set by state if they don't conflict
{{mount_point}}:
  mount.mounted:
    - device: {{mount_source}}
    - fstype: nfs
    - opts: {{std_opt}}{% print ','.join(tar_opt) %}
    - mount: False
    - dump: 0
    - mkmnt: True
    - pass_num: 0
    - persist: True


AFTER
mnt1 - no change
mnt2 - additional options put in place
mnt3 - dupicate entry. original entry still exists and now there is a new entry with the dump passnum (0 0) values. I would expect Salt to update the existing line and not recreate leaving the old line in place.
#grep test /etc/fstab
someshare:/test          /mnt1 nfs     bg,hard,vers=3,intr,timeo=600,tcp       0 0
someshare:/test          /mnt2 nfs     soft,hard,vers=3,intr,timeo=600,tcp       0 0
someshare:/test          /mnt3 nfs     bg,hard,vers=3,intr,timeo=600,tcp   
someshare:/test          /mnt3 nfs     bg,hard,vers=3,intr,timeo=600,tcp       0 0

Florian Ermisch

unread,
Aug 5, 2017, 3:05:28 AM8/5/17
to salt-...@googlegroups.com
Hi Mesa,

probably because Salt's parser for fstab
doesn't recognize an entry without those
values as a valid entry altogether and just
skips it. As the dump_no and pass_no
entries are optional on both GNU/Linux [0]
and OpenBSD [1] I'd dare to assume that's
how every system with a fstab handles it.
And "device" and mountpoint should be
enough to identify a mount (there
shouldn't be two lines with identical/
equivalent values for both entries) so it's
a bug anyway. Please open an issue at
https://github.com/saltstack/salt/issues/

Regards, Florian

[0]: https://linux.die.net/man/5/fstab
[1]: http://man.openbsd.org/fstab

Mesa

unread,
Aug 7, 2017, 4:25:20 PM8/7/17
to Salt-users, florian...@alumni.tu-berlin.de
Issue "#42775" opened with saltstack. we'll see what magic they come up with to resolve the issue.



Mesa

unread,
Aug 10, 2017, 10:10:02 AM8/10/17
to Salt-users, florian...@alumni.tu-berlin.de
Link to issue opened with salt stack. Just to make it easier for people to find. <salt issue 42775>
Reply all
Reply to author
Forward
0 new messages