Re: [PATCH] Test for ldap connectivity during lookup_ldap initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 08/18/2017 09:35 AM, Ian Kent wrote:
On 17/08/17 17:48, Oscar Salvador wrote:


On 08/16/2017 12:00 PM, Ian Kent wrote:
On 16/08/17 17:43, Ian Kent wrote:
On 16/08/17 17:39, Ian Kent wrote:

Could you have a look at:
autofs-5.1.2-wait-for-master-map-available-at-start.patch
autofs-5.1.2-add-master-read-wait-option.patch
autofs-5.1.2-work-around-sss-startup-delay.patch
autofs-5.1.2-add-sss-master-map-wait-config-option.patch
autofs-5.1.2-fix-included-master-map-not-found-return.patch
autofs-5.1.2-dont-fail-on-master-map-read-fail-timeout.patch
autofs-5.1.2-set-sane-default-master-read-wait-timeout.patch
autofs-5.1.2-dont-return-until-after-master-map-retry-read.patch
autofs-5.1.2-make-lookup_nss_read_master-return-nss-status.patch

found at https://www.kernel.org/pub/linux/daemons/autofs/v5/patches-5.1.3/.

And there's this one too.
autofs-5.1.2-fix-work-around-sss-startup-delay.patch


I can reproduce this with the latest version of autofs from git.

Sounds like my understanding of the problem is not right.

But it could also be I didn't actually use LDAP, I used NIS, I'll have to
try harder to replicate it.

With NIS you will not have any problem, it just works because open_lookup() returns NSS_STATUS_NOTFOUND in case it fails. But if you replace "nis" with "ldap" in /etc/nsswitch.conf, then you should be able to see the issue.


My setup is quite simple:

# git clone https://git.kernel.org/pub/scm/linux/storage/autofs/autofs.git
# ./configure && make && make install

# vim /etc/auto.master
/- auto.host
+auto.master

# vim /etc/auto.host
/data1  xx.xx.xx.xx:/mnt/export1
/data2  xx.xx.xx.xx:/mnt/export2
/data3    xx.xx.xx.xx:/mnt/export3

# grep autom /etc/nsswitch.conf
automount:    files ldap


# automount -d -v -f

# output of mounts (other terminal)
auto.host on /data3 type autofs (rw,relatime,fd=7,pgrp=29843,timeout=300,minproto=5,maxproto=5,direct)
auto.host on /data2 type autofs (rw,relatime,fd=7,pgrp=29843,timeout=300,minproto=5,maxproto=5,direct)
auto.host on /data1 type autofs (rw,relatime,fd=7,pgrp=29843,timeout=300,minproto=5,maxproto=5,direct)


# comment one mount in /etc/auto.host
# kill -HUP $(pidof automount)


Outcome:


do_hup_signal() -> do_read_master()[readall = 1] -> master_read_master()

I've only looked at it up to this point because I thought update meant removed
mount entry not being umounted but I think your actually saying subsequent map
not being re-read and so not being updated.

Is that what you mean?

No, sorry, maybe I didn't explain it correctly.
I'm not talking about mountpoints not being unmounted, but about maps not being updated.

f.i:

If I have

auto.host on /data3 type autofs (rw,relatime,fd=7,pgrp=29843,timeout=300,minproto=5,maxproto=5,direct) auto.host on /data2 type autofs (rw,relatime,fd=7,pgrp=29843,timeout=300,minproto=5,maxproto=5,direct) auto.host on /data1 type autofs (rw,relatime,fd=7,pgrp=29843,timeout=300,minproto=5,maxproto=5,direct)


then I comment /data3 in /etc/auto.host, and then I signal autofs with -HUP.
autofs will re-read the maps and update them, so /data3 will not appear anymore when executing "mount"


This works unless you have two lookup methods in /etc/nsswitch.conf, one of them being ldap and having ldap not being able to connect to its server.

This is why I came up with the latest patch from my previous comment.
In case you have two lookup methods, and one of them is working and the other not, you still should be able to update the maps since you at least got one method working.

Thanks
Oscar
--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux