Hello all. There is some strange thing going on with our OS X clients. We have created a package which is run via SystemStarter. What it does? It parses /etc/fstab and mounts the NFS directories mentioned there. This is needed since we want to have static mounts and the NetInfo-automounter combination does not do static mounts (even with ttl=0 set for the mount, which is supposed to do a static mount). Thanks Apple! Anyway, to manage /etc/fstab we have use: mount { "/home/student": atboot => true, device => "nfsserver:/path", ensure => present, fstype => nfs, options => "resvport,net,nodev,rw,intr,lock,hard,async,wsize=8192,rsize=8192", dump => 0, pass => 0, provider => parsed, target => "/etc/fstab", require => File["/mountpoint"], } So far so good, the idea is that puppet only checks if the entry is there, but nothing more. This happens, unfortunately it also unmounts the directory, but never does not mount it again, since "mount /mountpoint" does not work on OS X. According to the documentation on https://reductivelabs.com/cgi-bin/puppet.cgi/wiki/TypeReference#mount "ensure => present" does not looks only if the entry is there. But in /usr/lib/ruby/1.8/puppet/type/mount.rb I found (starting with line 16): newvalue(:present) do if provider.mounted? syncothers() provider.unmount return :mount_unmounted else provider.create return :mount_created end end Would it be possible to get rid of the "if" statement above and only do what the documentation and/or the keyword "present" suggests, namely enter the entry in fstab and do nothing more? Especially not the "unmount". OS X has the nasty behaviour of unmounting directories even if there are file locks open. Yes, I do not believe this myself, but it happens. Another solution would be to not only do "mount /mountpoint" but "mount -o options /device /mountpoint" as was suggested in another post here. This would work fine on OS X, and one could use the "ensure => mounted" with the "parsed" type. Thanks for reading and for your considerations, udo.
On Apr 30, 2007, at 3:59 AM, Udo Waechter wrote:> Hello all. > > There is some strange thing going on with our OS X clients. > > We have created a package which is run via SystemStarter. What it > does? > It parses /etc/fstab and mounts the NFS directories mentioned there. > This is needed since we want to have static mounts and the > NetInfo-automounter combination does not do static mounts (even with > ttl=0 set for the mount, which is supposed to do a static mount). > Thanks > Apple!Hmm, I hadn''t considered the possibility of using the ''parsed'' provider on OS X. Does OS X even use /etc/fstab? I expected that to be useless on OS X.> This happens, unfortunately it also unmounts the directory, but never > does not mount it again, since "mount /mountpoint" does not work on > OS X. > > According to the documentation on > https://reductivelabs.com/cgi-bin/puppet.cgi/wiki/TypeReference#mount > "ensure => present" does not looks only if the entry is there.The docs are actually somewhat ambiguous here, at best, but the point is that ''ensure'' supports three possible state (absent, present, and mounted), and setting the value determines the state. Thus, it will unmount the fs if it''s present and mounted.> But in /usr/lib/ruby/1.8/puppet/type/mount.rb I found (starting with > line 16): > > newvalue(:present) do > if provider.mounted? > syncothers() > provider.unmount > return :mount_unmounted > else > provider.create > return :mount_created > end > end > > Would it be possible to get rid of the "if" statement above and > only do > what the documentation and/or the keyword "present" suggests, namely > enter the entry in fstab and do nothing more? Especially not the > "unmount". OS X has the nasty behaviour of unmounting directories even > if there are file locks open. Yes, I do not believe this myself, > but it > happens.How would one unmount a filesystem without using ''unmount''?> Another solution would be to not only do "mount /mountpoint" but > "mount > -o options /device /mountpoint" as was suggested in another post here. > This would work fine on OS X, and one could use the "ensure => > mounted" > with the "parsed" type.I don''t remember that post, but I would be fine with that. I''ll test it today, and if it seems to work in my limited testing, I''ll release that in 0.22.4. -- If I want your opinion, I''ll read your entrails. --Doug Shewfelt --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Hi. On 30.04.2007, at 17:00, Luke Kanies wrote:> On Apr 30, 2007, at 3:59 AM, Udo Waechter wrote: > > Hmm, I hadn''t considered the possibility of using the ''parsed'' > provider on OS X. > > Does OS X even use /etc/fstab? I expected that to be useless on OS X. >No, fresh installation of 10.4.4+ does not use it. Update versions from 10.3.x to 10.4.x do it, for whatever reasons. Anyway, we wrote a StartupItem which parses the /etc/fstab and mounts all NFS entries. This is due to the fact that static mounts via the automounter DO NOT WORK under 10.4.4+. Although the documentations suggests that ttl=0 as a mount option would do so, it does not. We have a lot of Desktop Workstations which use nfs-home-directories, thus we need the static mounts. The Apple guys really f**ked this up! The deeper you develve under OSX''s hood, the uglier and the more inconsistent this operating system gets.>> This happens, unfortunately it also unmounts the directory, but never >> does not mount it again, since "mount /mountpoint" does not work on >> OS X. >> >> According to the documentation on >> https://reductivelabs.com/cgi-bin/puppet.cgi/wiki/TypeReference#mount >> "ensure => present" does not looks only if the entry is there. > > The docs are actually somewhat ambiguous here, at best, but the point > is that ''ensure'' supports three possible state (absent, present, and > mounted), and setting the value determines the state. Thus, it will > unmount the fs if it''s present and mounted.I interpreted the documentations as follows: mounted: see that the entry exists in fstab or netinfo and that it is mounted. absent: delete the entry, do nothing more (or unmount it) present: see that the entry is there but do nothing else>> what the documentation and/or the keyword "present" suggests, namely >> enter the entry in fstab and do nothing more? Especially not the >> "unmount". OS X has the nasty behaviour of unmounting directories >> even >> if there are file locks open. Yes, I do not believe this myself, >> but it >> happens. > How would one unmount a filesystem without using ''unmount''? >not at all :) I do mean that the unmount should not be done in ''ensure => present''.>> Another solution would be to not only do "mount /mountpoint" but >> "mount >> -o options /device /mountpoint" as was suggested in another post >> here. >> This would work fine on OS X, and one could use the "ensure => >> mounted" >> with the "parsed" type. > I don''t remember that post, but I would be fine with that. I''ll test > it today, and if it seems to work in my limited testing, I''ll release > that in 0.22.4.If puppet actually uses "mount server:/path /mountpoint" instead of only "mount /mountpoint", there won''t be a problem at all with ''present'' unmounting the dir. "mount /mountpoint" does not work under OS X 10.4.4+ , even if the entry is done via NetInfo, since those entries are handled via the automounter. I will be able to test this on wednesday. Thanks for the help, udo. -- ---[ Institute of Cognitive Science @ University of Osnabrueck ---[ Albrechtstrasse 28, D-49076 Osnabrueck, 969-3362 ---[ Eyes: http://www.zoide.net/ ---[ Ears: http://www.auriculabovinari.de/
On May 1, 2007, at 3:51 AM, udo waechter wrote:> No, fresh installation of 10.4.4+ does not use it. Update versions > from 10.3.x to 10.4.x do it, for whatever reasons. Anyway, we wrote a > StartupItem which parses the /etc/fstab and mounts all NFS entries. > This is due to the fact that static mounts via the automounter DO NOT > WORK under 10.4.4+. Although the documentations suggests that ttl=0 > as a mount option would do so, it does not. We have a lot of Desktop > Workstations which use nfs-home-directories, thus we need the static > mounts. The Apple guys really f**ked this up! The deeper you develve > under OSX''s hood, the uglier and the more inconsistent this operating > system gets.Ah, so static mounts don''t work at all from NetInfo, so there''s no point in even trying to modify it? That''s a big relief, anyway, since that provider was a total PITA.> I interpreted the documentations as follows: > mounted: see that the entry exists in fstab or netinfo and that it is > mounted. > absent: delete the entry, do nothing more (or unmount it) > present: see that the entry is there but do nothing elseThink of it as a state machine, and the mount can be in one and only one state. If you choose ''present'', then it will move there from either ''absent'' or ''mounted''. Now that you bring that up, though, I should probably support this idea of ''present'' matching anything but ''absent'', and use another name for ''present''. Hmm.> not at all :) I do mean that the unmount should not be done in > ''ensure => present''.That''s not going away, since people need a way to say a filesystem shouldn''t be mounted. However, I''ll see about adding another term, so you can get the behaviour you want.> If puppet actually uses "mount server:/path /mountpoint" instead of > only "mount /mountpoint", there won''t be a problem at all with > ''present'' unmounting the dir. "mount /mountpoint" does not work under > OS X 10.4.4+ , even if the entry is done via NetInfo, since those > entries are handled via the automounter.This should all be working now in 0.22.4. -- Zeilinger''s Fundamental Law: There is no Fundamental Law. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Hi, On 02.05.2007, at 20:37, Luke Kanies wrote:> On May 1, 2007, at 3:51 AM, udo waechter wrote: >> No, fresh installation of 10.4.4+ does not use it. Update versions >> from 10.3.x to 10.4.x do it, for whatever reasons. Anyway, we wrote a >> StartupItem which parses the /etc/fstab and mounts all NFS entries. >> This is due to the fact that static mounts via the automounter DO NOT >> WORK under 10.4.4+. Although the documentations suggests that ttl=0 >> as a mount option would do so, it does not. We have a lot of Desktop >> Workstations which use nfs-home-directories, thus we need the static >> mounts. The Apple guys really f**ked this up! The deeper you develve >> under OSX''s hood, the uglier and the more inconsistent this operating >> system gets. > > Ah, so static mounts don''t work at all from NetInfo, so there''s no > point in even trying to modify it?Well, they are supposed to be static when you tell the automounter to have "time-to-live 0" for the mount. This is an option: ttl=0 But for us it did not work.> That''s a big relief, anyway, since that provider was a total PITA.Well now I am in the situation that I have the first puppet-managed OS X machine. Here, I would like to make the mounts dynamic (with all the annoying implications). For this, the NetInfo provider is needed. A first check on friday revealed that it does not really work since it tries to alter already existing entries in the NetInfo database. This fails if there are no entries to manage. I hope to have some time later to look at the provider. I am pretty familiar with the command line niutils, I think I can find the problems and fix them.>> not at all :) I do mean that the unmount should not be done in >> ''ensure => present''. > That''s not going away, since people need a way to say a filesystem > shouldn''t be mounted. >OK, I have the feeling that we are misunderstanding each other. I mean that in ht process of creating an "ensure => present" mount, there should be no ''unmount'' step. As I see it it goes like this right now: 1. unmount the currently mounted dir 2. change the mount entries (if necessary) in provider. 3. mount it again. I think that step 1 and 3 should not be there as they are, instead a remount might help.> However, I''ll see about adding another term, so you can get the > behaviour you want. >I do not think this is necessary, provided that in 0.22.4 puppet does "mount /device /target" instead of "mount /target". Then I can use "ensure => mounted" even on OS X. Everything is fine then. thanks, udo. -- ---[ Institute of Cognitive Science @ University of Osnabrueck ---[ Albrechtstrasse 28, D-49076 Osnabrueck, 969-3362 ---[ Eyes: http://www.zoide.net/ ---[ Ears: http://www.auriculabovinari.de/
On May 5, 2007, at 2:43 AM, udo waechter wrote:> Well, they are supposed to be static when you tell the automounter to > have "time-to-live 0" for the mount. This is an option: ttl=0 But for > us it did not work.Ah.> Well now I am in the situation that I have the first puppet-managed > OS X machine. Here, I would like to make the mounts dynamic (with all > the annoying implications). For this, the NetInfo provider is needed. > A first check on friday revealed that it does not really work since > it tries to alter already existing entries in the NetInfo database. > This fails if there are no entries to manage. > I hope to have some time later to look at the provider. I am pretty > familiar with the command line niutils, I think I can find the > problems and fix them.The netinfo provider for ''mount'' is currently commented out, because I couldn''t get it to use the ''device'' as the key, instead of the mount point like I''m using for the parsed provider. That''s the main problem, other than the fact that (as you say) OS X''s ''mount'' command ignores NetInfo and thus you can''t use ''ensure => mounted''.>> That''s not going away, since people need a way to say a filesystem >> shouldn''t be mounted. >> > OK, I have the feeling that we are misunderstanding each other. I > mean that in ht process of creating an "ensure => present" mount, > there should be no ''unmount'' step. > As I see it it goes like this right now: > 1. unmount the currently mounted dir > 2. change the mount entries (if necessary) in provider. > 3. mount it again. > > I think that step 1 and 3 should not be there as they are, instead a > remount might help.Ah. I use ''mount -o remount'' when it looks like the local mount command supports it; otherwise I''m stuck with ''mount; unmount''. I found no matches for ''remount'' in OS X''s ''mount'' man page, thus I assumed it wasn''t available. Is it?> I do not think this is necessary, provided that in 0.22.4 puppet does > "mount /device /target" instead of "mount /target". Then I can use > "ensure => mounted" even on OS X. Everything is fine then.Yep, it does. -- "They called me mad, and I called them mad, and damn them, they outvoted me." -- Nathaniel Lee, on being consigned to a mental institution, circa 17th c. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Luke Kanies wrote:> On May 5, 2007, at 2:43 AM, udo waechter wrote: >> Well, they are supposed to be static when you tell the automounter to >> have "time-to-live 0" for the mount. This is an option: ttl=0 But for >> us it did not work. > > Ah.The automount process in Mac OS X 10.4 and earlier is absolutely horrible. Keep an eye on 10.5, they''re replacing it with autofs. Of other interest, I''ve started playing with autofs from MacPorts in 10.4 to fix some problems I have with Apple''s automount, so you might want to try that as well.>> Well now I am in the situation that I have the first puppet-managed >> OS X machine. Here, I would like to make the mounts dynamic (with all >> the annoying implications). For this, the NetInfo provider is needed. >> A first check on friday revealed that it does not really work since >> it tries to alter already existing entries in the NetInfo database. >> This fails if there are no entries to manage. >> I hope to have some time later to look at the provider. I am pretty >> familiar with the command line niutils, I think I can find the >> problems and fix them. > > The netinfo provider for ''mount'' is currently commented out, because > I couldn''t get it to use the ''device'' as the key, instead of the > mount point like I''m using for the parsed provider. That''s the main > problem, other than the fact that (as you say) OS X''s ''mount'' command > ignores NetInfo and thus you can''t use ''ensure => mounted''.I''ve intended to replace the NetInfo provider for awhile now, but just haven''t made the time. If you poke at it, just keep in mind that NetInfo is not longed for this world, and you should really use dscl to modify the Directory rather than niutil. In addition, Mount Records in NetInfo are more for the automount system. The documentation you''ve probably read that discusses creating "static" mounts in NetInfo really just create automount records that area always mounted. Mac OS X does honor /etc/fstab, albeit strangely. I key everything in my /etc/fstab off the GUID of the volume, e.g. UUID=8DF05672-983E-3AFA-A96A-C200981FDFA5 \ /Support hfs rw,auto,nobrowse 0 0 UUID=88E329E7-B665-3B97-BE2E-E289D1714300 \ /Scratch hfs rw,auto 0 0 Paths to devices work here as well, though I personally prefer GUID''s in the event a disk number is re-ordered for whatever reason. I guess I really need to try and find the time to fix some of the core providers for Mac OS X.>>> That''s not going away, since people need a way to say a filesystem >>> shouldn''t be mounted. >>> >> OK, I have the feeling that we are misunderstanding each other. I >> mean that in ht process of creating an "ensure => present" mount, >> there should be no ''unmount'' step. >> As I see it it goes like this right now: >> 1. unmount the currently mounted dir >> 2. change the mount entries (if necessary) in provider. >> 3. mount it again. >> >> I think that step 1 and 3 should not be there as they are, instead a >> remount might help. > > Ah. I use ''mount -o remount'' when it looks like the local mount > command supports it; otherwise I''m stuck with ''mount; unmount''. I > found no matches for ''remount'' in OS X''s ''mount'' man page, thus I > assumed it wasn''t available. Is it? >Just an FYI, mount -o remount works well in Mac OS X. -- Jeff McCune The Ohio State University Department of Mathematics Systems Manager _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On May 8, 2007, at 9:17 AM, Jeff McCune wrote:> > The automount process in Mac OS X 10.4 and earlier is absolutely > horrible. Keep an eye on 10.5, they''re replacing it with autofs. > > Of other interest, I''ve started playing with autofs from MacPorts in > 10.4 to fix some problems I have with Apple''s automount, so you might > want to try that as well.That should just be a question of another provider, fortunately.> I''ve intended to replace the NetInfo provider for awhile now, but just > haven''t made the time. If you poke at it, just keep in mind that > NetInfo is not longed for this world, and you should really use > dscl to > modify the Directory rather than niutil.I wish dscl actually solved any of the problems with NetInfo (mainly, there is no real model in NetInfo -- you can put whatever crap you want in there and it may or may not work).> In addition, Mount Records in NetInfo are more for the automount > system. > The documentation you''ve probably read that discusses creating > "static" > mounts in NetInfo really just create automount records that area > always > mounted. > > Mac OS X does honor /etc/fstab, albeit strangely. I key everything in > my /etc/fstab off the GUID of the volume, e.g. > > UUID=8DF05672-983E-3AFA-A96A-C200981FDFA5 \ > /Support hfs rw,auto,nobrowse 0 0 > UUID=88E329E7-B665-3B97-BE2E-E289D1714300 \ > /Scratch hfs rw,auto 0 0 > > Paths to devices work here as well, though I personally prefer > GUID''s in > the event a disk number is re-ordered for whatever reason. > > I guess I really need to try and find the time to fix some of the core > providers for Mac OS X.That would be great. Every time I look at them I get the hives.> Just an FYI, mount -o remount works well in Mac OS X.Well that''s a simple fix, and you''ve got commit access. Sounds like a great place to start fixing things. :) -- We are here on Earth to do good to others. What the others are here for, I don''t know. -- W. H. Auden --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
在 8 May , 2007,10:17,Jeff McCune 写道:> Mac OS X does honor /etc/fstab, albeit strangely. I key everything in > my /etc/fstab off the GUID of the volume, e.g. > > UUID=8DF05672-983E-3AFA-A96A-C200981FDFA5 \ > /Support hfs rw,auto,nobrowse 0 0 > UUID=88E329E7-B665-3B97-BE2E-E289D1714300 \ > /Scratch hfs rw,auto 0 0 > > Paths to devices work here as well, though I personally prefer > GUID's in > the event a disk number is re-ordered for whatever reason. > > I guess I really need to try and find the time to fix some of the core > providers for Mac OS X.I also note that niload fstab doesn't function to load anything into the nidb (regardless of it would be honored once there). That behavior may be limited to new style fstab entries, but it's clear Apple isn't spending any tears demolishing vestiges. _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Luke Kanies wrote:>> Just an FYI, mount -o remount works well in Mac OS X. > > Well that''s a simple fix, and you''ve got commit access. Sounds like a > great place to start fixing things. :)Fixed in [r2498]. That was ridiculously simple. =) Cheers, -- Jeff McCune Systems Manager The Ohio State University Department of Mathematics _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On May 9, 2007, at 1:58 PM, Jeff McCune wrote:> Luke Kanies wrote: >>> Just an FYI, mount -o remount works well in Mac OS X. >> Well that''s a simple fix, and you''ve got commit access. Sounds >> like a great place to start fixing things. :) > > Fixed in [r2498]. > > That was ridiculously simple. =)Great, thanks. -- The great thing about television is that if something important happens anywhere in the world, day or night, you can always change the channel. -- From "Taxi" --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com