Jira (PUP-9172) Mounts with symlinks get continually remounted

3 views
Skip to first unread message

Alan Smith (JIRA)

unread,
Sep 24, 2018, 5:01:11 PM9/24/18
to puppe...@googlegroups.com
Alan Smith created an issue
 
Puppet / Bug PUP-9172
Mounts with symlinks get continually remounted
Issue Type: Bug Bug
Affects Versions: PUP 5.5.1, PUP 4.10.0
Assignee: Unassigned
Attachments: mounttmp.pp
Components: Types and Providers
Created: 2018/09/24 2:00 PM
Environment:

Ran across this on production systems, reproduced in docker. The prod systems are running linux and puppet v4.8.

$ docker run -it --rm --entrypoint /bin/sh puppet/puppet-agent -c 'cat /etc/lsb-release'
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
 
$ docker run -it --rm --entrypoint /bin/sh puppet/puppet-agent -c 'uname -a'
Linux 869e365b95ba 4.9.93-linuxkit-aufs #1 SMP Wed Jun 6 16:55:56 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Priority: Normal Normal
Reporter: Alan Smith

Puppet Version: 5.5.1
Puppet Server Version: N/A
OS Name/Version: Linux

Possibly related to this `mount` tmpfs bug that was never reproduced.

Using the `mount` type/provider on linux systems – possibly BSD/Unix-like systems as well, not tested – if a mount is created at a path that contains a symlink, the mount will be created newly each puppet run.

Repro steps:

Using mounttmp.pp:

$ docker pull puppet/puppet-agent
$ cat >mounttmp.pp <<-EOF
\$dir = '/var/run/test'
\$dir2 = '/run/test2'
exec { 'dir':
    command => "/bin/mkdir -p \${dir} \${dir2}",
}
mount { [\$dir, \$dir2]:
    ensure => mounted,
    fstype => tmpfs,
    device => tmpfs,
    options => 'size=1m',
    remounts => false,
    require => Exec['dir'],
}
EOF
$ check="mount | grep /test" && puppet='puppet apply --verbose -e "$(cat /workspace/code.pp)"'
$ docker run --hostname test.example.com --cap-add=SYS_ADMIN -it --rm --entrypoint 'sh' -v $PWD/mounttmp.pp:/workspace/code.pp puppet/puppet-agent -c "$check ; $puppet ; $check ; $puppet ; $check"

Desired Behavior:

`Mount[/var/run/test]` should not create duplicate mounts every puppet run.

Actual Behavior:

$ docker run -it --rm puppet/puppet-agent --version
5.5.1
$ cat mounttmp.pp
$dir = '/var/run/test'
$dir2 = '/run/test2'
exec { 'dir':
    command => "/bin/mkdir -p ${dir} ${dir2}",
}
mount { [$dir, $dir2]:
    ensure => mounted,
    fstype => tmpfs,
    device => tmpfs,
    options => 'size=1m',
    remounts => false,
    require => Exec['dir'],
}
$ check="mount | grep /test" && puppet='puppet apply --test --trace -e "$(cat /workspace/code.pp)"'
$ docker run --hostname test.example.com --cap-add=SYS_ADMIN -it --rm --entrypoint 'sh' -v $PWD/mounttmp.pp:/workspace/code.pp puppet/puppet-agent -c "$check ; $puppet ; $check ; $puppet ; $check"
Notice: Compiled catalog for test.example.com in environment production in 0.07 seconds
Info: Applying configuration version '1537822009'
Notice: /Stage[main]/Main/Exec[dir]/returns: executed successfully
Notice: /Stage[main]/Main/Mount[/var/run/test]/ensure: defined 'ensure' as 'mounted'
Info: Computing checksum on file /etc/fstab
Info: /Stage[main]/Main/Mount[/var/run/test]: Scheduling refresh of Mount[/var/run/test]
Info: Mount[/var/run/test](provider=parsed): Remounting
Notice: /Stage[main]/Main/Mount[/var/run/test]: Triggered 'refresh' from 1 event
Info: /Stage[main]/Main/Mount[/var/run/test]: Scheduling refresh of Mount[/var/run/test]
Notice: /Stage[main]/Main/Mount[/run/test2]/ensure: defined 'ensure' as 'mounted'
Info: /Stage[main]/Main/Mount[/run/test2]: Scheduling refresh of Mount[/run/test2]
Info: Mount[/run/test2](provider=parsed): Remounting
Notice: /Stage[main]/Main/Mount[/run/test2]: Triggered 'refresh' from 1 event
Info: /Stage[main]/Main/Mount[/run/test2]: Scheduling refresh of Mount[/run/test2]
Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
Notice: Applied catalog in 0.16 seconds
tmpfs on /run/test type tmpfs (rw,relatime,size=1024k)
tmpfs on /run/test2 type tmpfs (rw,relatime,size=1024k)
Notice: Compiled catalog for test.example.com in environment production in 0.07 seconds
Info: Applying configuration version '1537822012'
Notice: /Stage[main]/Main/Exec[dir]/returns: executed successfully
Notice: /Stage[main]/Main/Mount[/var/run/test]/ensure: ensure changed 'unmounted' to 'mounted'
Info: /Stage[main]/Main/Mount[/var/run/test]: Scheduling refresh of Mount[/var/run/test]
Info: Mount[/var/run/test](provider=parsed): Remounting
Notice: /Stage[main]/Main/Mount[/var/run/test]: Triggered 'refresh' from 1 event
Info: /Stage[main]/Main/Mount[/var/run/test]: Scheduling refresh of Mount[/var/run/test]
Notice: Applied catalog in 0.11 seconds
tmpfs on /run/test type tmpfs (rw,relatime,size=1024k)
tmpfs on /run/test2 type tmpfs (rw,relatime,size=1024k)
tmpfs on /run/test type tmpfs (rw,relatime,size=1024k)

 Notice the `tmpfs on /run/test...` lines show `/run/test` and `/run/test2` as being present once in the mounttab after the first run, but `/run/test` appears twice after the second run. The only difference is that `/run/test` is being created by `Mount[/var/run/test]` vs `Mount[/run/test2]` (`/var/run` is a symlink to `/run`).

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Oct 1, 2018, 2:48:06 PM10/1/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Platform OS

Scott McClellan (JIRA)

unread,
Oct 15, 2018, 2:26:06 PM10/15/18
to puppe...@googlegroups.com
Scott McClellan updated an issue
Change By: Scott McClellan
Labels: linux mount symlinks type_and_provider

Josh Cooper (Jira)

unread,
Jun 14, 2021, 6:49:03 PM6/14/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9172
 
Re: Mounts with symlinks get continually remounted

The mount type and provider have been moved to an external module, so I'm going to move this to the MODULES project.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages