autofs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.com>
To: Ian Kent <raven@themaw.net>, autofs@vger.kernel.org
Subject: Re: [PATCH] Test for ldap connectivity during lookup_ldap initialization
Date: Fri, 18 Aug 2017 10:03:32 +0200	[thread overview]
Message-ID: <6aef666c-c776-1924-c391-f0e3340c19cd@suse.com> (raw)
In-Reply-To: <301dc10b-dcf7-af3b-a1e1-d9008f8e7e76@themaw.net>



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

      parent reply	other threads:[~2017-08-18  8:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 21:15 [PATCH] Test for ldap connectivity during lookup_ldap initialization Oscar Salvador
2017-08-16  5:02 ` Ian Kent
2017-08-16  5:46   ` Ian Kent
2017-08-16  7:21     ` Oscar Salvador
2017-08-16  8:25       ` Ian Kent
2017-08-16  9:39         ` Ian Kent
2017-08-16  9:43           ` Ian Kent
2017-08-16 10:00             ` Ian Kent
2017-08-17  9:48               ` Oscar Salvador
2017-08-18  7:35                 ` Ian Kent
2017-08-18  7:54                   ` Ian Kent
2017-08-18  8:03                   ` Oscar Salvador [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6aef666c-c776-1924-c391-f0e3340c19cd@suse.com \
    --to=osalvador@suse.com \
    --cc=autofs@vger.kernel.org \
    --cc=raven@themaw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).