Issue #2731 has been updated by Jonathan Stanton.
I can't find the man page where I saw the 32 return value meaning "already mounted" but I can duplicate how the mount command line program does know the difference between a failed mount because it's already mounted and a failed mount for other reasons (permisssions, no portmap, etc). See the following commands I ran on the same machine as before when trying the same mount command that puppet does (copied from the puppet log) <pre> r...@savage-file:/var/log# /bin/mount -o rw,async /mnt/moose_home mount.nfs: /mnt/moose_home is already mounted or busy r...@savage-file:/var/log# echo $? 32 </pre> So mount.nfs is actually getting an EBUSY errno (from the mount syscall) not a EPERM or EINVAL. So it prints the error that it is already mounted, but also has a return value of 32. Now if I try the exact same mount but give the "remount" option so it tries to remount an existing mount I get success: <pre> r...@savage-file:/var/log# /bin/mount -o remount,rw,async /mnt/moose_home r...@savage-file:/var/log# echo $? 0 </pre> which would indicate success to Puppet and allow it to mark the nfs partition as in mounted state. Maybe the linux/mount provider in puppet needs to either check if the partition is already mounted (and then stop trying to mount it) or it should try with the "remount" option first and if that fails (as it is documented in the mount man page to fail with EINVAL if it is attempted on a source that is not already mounted) then it will mount it without the remount option. ---------------------------------------- Bug #2731: mount on linux does not recognize errror code 32 meaning already mounted http://projects.reductivelabs.com/issues/2731 Author: Jonathan Stanton Status: Needs more information Priority: Normal Assigned to: Category: mount Target version: Affected version: 0.24.8 Keywords: Branch: On a Centos 5.3 system with NFS mounting home directories, every time puppet runs it tries to update the status of the nfs mount from "present" to "mounted" but fails because the call to mount returns -32 not 0. But as documented on the man page -32 means 'already mounted' and so should be treated as success. Here is the logged message from puppetd. Oct 16 10:28:07 savage-file puppetd[11739]: (//Node[savage-file.livetimenet.com]/nfs_moose_client/Mount[/mnt/moose_home]/ensure) change from present to mounted failed: Execution of '/bin/mount -o rw,async /mnt/moose_home' returned 32: This has been going on for awhile (certainly back several versions of puppet) and I've tried some ideas with restarting it, and letting puppet do the original mount instead of the OS mounting it directly. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://reductivelabs.com/redmine/my/account --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en -~----------~----~----~----~------~----~------~--~---
