Puppet: System Administration Automated

Support

Ticket #761 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

mount tries to mount an already mounted FS

Reported by: porridge Assigned to: luke
Priority: normal Milestone: misspiggy
Component: library Version: 0.23.2
Severity: normal Keywords: mount
Cc: Triage Stage: Accepted
Attached Patches: Code Complexity: Unknown

Description (Last modified by DavidS)

This is in 0.23.2 (there's a missing value in trac's drop-down menu). This problem surfaced right after upgrading from 0.22.4-ish.

        mount { "/home":
                require => [
                        File["/home"],
                        Gu_file["/opt/etc/facts"]
                ],
                atboot => yes,
                blockdevice => "-",
                device  => "netapp03.gudev.gnl:/vol/gu1/common/home",
                ensure => mounted,
                fstype => nfs,
                options => "rw,nosuid,noquota",
                pass =>  "-",
                dump => 0,
        }

The status is:

# grep home /etc/vfstab
netapp03.gudev.gnl:/vol/gu1/common/home -       /home   nfs     -       yes     rw,nosuid,noquota

# mount|grep home
/home on netapp03.gudev.gnl:/vol/gu1/common/home remote/read/write/setuid/devices/xattr/dev=4bc0001 on Wed Aug  8 11:07:06 2007

# df|grep home
/home              (netapp03.gudev.gnl:/vol/gu1/common/home):95074608 blocks 23663420 files

# df -k|grep home
netapp03.gudev.gnl:/vol/gu1/common/home 1018135840 970598548 47537292    96%    /home

Puppetd shows the following errors/warnings on each run, for every single filesystem it controls, which is already mounted:

puppetd[2353]: [ID 702911 daemon.error] (//codguweb01/common/nfs_mounted_home_directory/Mount[/home]/ensure) change from present to mounted failed: Execution of '/usr/sbin/mount -o rw,nosuid,noquota /home' returned 8448: nfs mount: mount: /home: Device busy
puppetd[2353]: [ID 702911 daemon.notice] (//codguweb01/common/nfs_mounted_home_directory/Mount[/home]) Refreshing self

Change History

08/15/07 07:28:46 changed by luke

Marked #769 as a duplicate.

08/15/07 07:29:02 changed by luke

  • version changed from 0.23.1 to 0.23.2.
  • milestone set to misspiggy.

09/06/07 19:59:49 changed by michael

  • stage changed from Unreviewed to Accepted.

09/14/07 20:12:48 changed by luke

Marking #785 as a duplicate.

11/06/07 09:18:16 changed by DavidS

  • description changed.

fixed markup

11/06/07 09:23:31 changed by DavidS

I could not reproduce this with a local mount under Debian sid:

mount { "/backup":
    device => "LABEL=NEW_BACKUP",
    ensure => mounted,
    atboot => no, fstype => ext3,
    options => "rw,noauto",
}

Here the output of current HEAD:

david@zion:~/Work/puppet/puppet$ sudo bash -c 'RUBYLIB=./lib/ ./bin/puppet /tmp/test_mount.pp' 
notice: //Mount[/backup]/ensure: ensure changed 'present' to 'mounted'
notice: //Mount[/backup]: Refreshing self
david@zion:~/Work/puppet/puppet$ sudo bash -c 'RUBYLIB=./lib/ ./bin/puppet /tmp/test_mount.pp' 
david@zion:~/Work/puppet/puppet$ 

The misspiggy branch behaves the same. I have no NFS mounts to test though.

11/06/07 09:49:38 changed by DavidS

But a short look at the source reveals a (the?) problem:

From lib/puppet/provider/mount.rb:mounted?:

line =~ / on #{name} /

name is the name of the resource, which is the mount point. The reporter's system though has it the wrong way around for this regex:

/home on netapp03.gudev.gnl:/vol/gu1/common/home [...]

Which causes the whole test to fail. A fix should be quite trivial once the reporter's system is identified.

11/06/07 10:21:31 changed by DavidS

porridge said on IRC that this happened on Solaris 10. Further checking revealed the same format at least on Solaris 8 and 9 too.

11/06/07 15:22:48 changed by DavidS

  • patch changed from None to Code.

A fix for this is available in the misspiggy/fix-761 branch available from my repo at git://git.black.co.at/puppet-bugfixes

11/09/07 00:07:33 changed by luke

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [3f583dc133ce50ae34bfc151474c6d4196f803ca].

I couldn't use DavidS's patch because it wasn't syntactically correctly (elsif instead of if), and I wanted to add unit tests for this code, too.