Odd NIS map failure with mount point creation time in the future?
I using CentOS 5 on a large number of boxes with a NIS indirect automount map.
I've been using the following syntax in /etc/auto.master:
/mntpoint yp:custom.map
And this has worked fine for ages
Recently, I wanted to provide some custom local overrides to mount points in the NIS map, so I've changed /etc/auto.master to be:
/mntpoint custom.map
and created a file called /etc/custom.map which contains something like:
host1 host:/disk1
+custom.map
i.e. include the NIS map after any local mount point settings
On most machines, this works fine - but on a number of machines, after a reboot, the mounts from the NIS map fail to mount - although the other mounts from /etc/custom.map mount fine.
One thing I noticed in common on all the machines with this problem is that datestamp on the automount mount point (/mntpoint) was in the future - by an hour or two. I guess the hardware clock is an hour or two ahead of the real time.
ntp runs on all these boxes - but starts after autofs - however if I change ntp to startup before autofs, then autofs works fine after a reboot ...
Any idea why autofs fails to read entries from the included NIS map when the creation date of the map mount point is in the future? - but works fine when the same NIS map is referenced directly from /etc/auto.master?
James Pearson
Ian Kent
maintainerQuoted 30 lines · James Pearson
I using CentOS 5 on a large number of boxes with a NIS indirect automount map.
I've been using the following syntax in
/etc/auto.master:/mntpoint yp:custom.map
And this has worked fine for ages
Recently, I wanted to provide some custom local overrides to mount points in the NIS map, so I've changed
/etc/auto.masterto be:/mntpoint custom.map
and created a file called
/etc/custom.mapwhich contains something like:host1 host:/disk1
+custom.mapi.e. include the NIS map after any local mount point settings
On most machines, this works fine - but on a number of machines, after a reboot, the mounts from the NIS map fail to mount - although the other mounts from
/etc/custom.mapmount fine.One thing I noticed in common on all the machines with this problem is that datestamp on the automount mount point (/mntpoint) was in the future - by an hour or two. I guess the hardware clock is an hour or two ahead of the real time.
Quoted 7 lines
ntp runs on all these boxes - but starts after autofs - however if I change ntp to startup before autofs, then autofs works fine after a reboot ...
Any idea why autofs fails to read entries from the included NIS map when the creation date of the map mount point is in the future? - but works fine when the same NIS map is referenced directly from
/etc/auto.master?
Don't know about the timestamp but there were some included map fixes in RHEL-5.7, at least one was a fix for a regression.
Versions?
Quoted 7 lines
James Pearson
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs
Quoted 8 lines · Ian Kent
Quoted 2 lines
Any idea why autofs fails to read entries from the included NIS map when the creation date of the map mount point is in the future? - but works fine when the same NIS map is referenced directly from
/etc/auto.master?Don't know about the timestamp but there were some included map fixes in RHEL-5.7, at least one was a fix for a regression.
Versions?
Sorry, I should have said - this is CentOS 5.5 with autofs 5.0.1-0.rc2.143.el5_5.6 - and I've also tried it with 5.0.1-0.rc2.143.el5_6.2 - with the same result.
It is easy to reproduce - with an included NIS map - if I do:
/etc/init.d/autofs stop; date -s "1 minute"; /etc/init.d/autofs start; date -s "-1 minute"
This creates the automount mount point 1 minute into the future.
Then if I try to access a server defined in the NIS map, the mount fails.
However, if I wait a minute (i.e until the system clock passes the date stamp of the mount point), the automount of file systems in the NIS map works fine.
Is it possible to get a copy of the autofs RPM for RHEL-5.7 to test?
Thanks
James Pearson
A message that is not in the archive (sent off-list or not yet received): [email protected]
Ian Kent
maintainerQuoted 34 lines · James Pearson
Quoted 12 lines · James Pearson
Sorry, I should have said - this is CentOS 5.5 with autofs 5.0.1-0.rc2.143.el5_5.6 - and I've also tried it with 5.0.1-0.rc2.143.el5_6.2 - with the same result.
It is easy to reproduce - with an included NIS map - if I do:
/etc/init.d/autofsstop; date -s "1 minute";/etc/init.d/autofsstart; date -s "-1 minute"This creates the automount mount point 1 minute into the future.
Quoted 7 lines
Then if I try to access a server defined in the NIS map, the mount fails.
However, if I wait a minute (i.e until the system clock passes the date stamp of the mount point), the automount of file systems in the NIS map works fine.
Is it possible to get a copy of the autofs RPM for RHEL-5.7 to test?
I had a look at the RHEL5 5.0.1-0.rc2.143.el5_6.2 source - and the following patch appears to 'fix' my problem - it's a bit of a hack - as in the included NIS map case, it just resets the age of the map to 'now', if it is in the future.
James Pearson
plain text document attachment (autofs-5.0.1-future.patch)
daemon/lookup.c renamed from daemon/lookup.c.mpc +0
-0@@ -848,6 +848,12 @@ int lookup_nss_mount(struct autofs_pointstruct map_source *map;enum nsswitch_status status;
daemon/lookup.c int lookup_nss_mount(struct autofs_point · line 859
Quoted 10 lines
daemon/lookup.c renamed from daemon/lookup.c.mpc +6
-0int result =0 ; +time_t now =time (NULL ); + +if (entry->age > now) { +debug (ap->logopt,"map %s age in the future - changing it to now" , entry->path); + entry->age = now; + }/* * For each map source (ie. each entry for the mount
That sounds a bit like bug
https://bugzilla.redhat.com/show_bug.cgi?id=632471
It was fixed in development revision 152, which I happen to have on people.redhat.com. You could give that a try.
http://people.redhat.com/~ikent/autofs-5.0.1-0.rc2.152.el5/
Keep in mind that there were a few other fixes that went into the final release version so your mileage may vary.
Ian
Quoted 3 lines · Ian Kent
That sounds a bit like bug
https://bugzilla.redhat.com/show_bug.cgi?id=632471
I don't have permission to view that bug ...
Quoted 4 lines
It was fixed in development revision 152, which I happen to have on people.redhat.com. You could give that a try.
Unfortunately, this version doesn't help ...
Thanks
James Pearson
Ian Kent
maintainerQuoted 5 lines · James Pearson
Quoted 3 lines · Ian Kent
That sounds a bit like bug
https://bugzilla.redhat.com/show_bug.cgi?id=632471
Quoted 8 lines
I don't have permission to view that bug ...
Quoted 4 lines
It was fixed in development revision 152, which I happen to have on people.redhat.com. You could give that a try.
Unfortunately, this version doesn't help ...
OK, I'll try and reproduce it.
Quoted 4 lines
Thanks
James Pearson