清野と申します.

/etc/nsswitch.conf ですが,

> passwd: files
> passwd_compat: nis ldap

とした場合,passwd ファイルを以下の様に修正する必要があります.

www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
+:*::::::::
ldap:*:389:389::0:0:OpenLDAP Server:/nonexistent:/sbin/nologin

こういった挙動から,_compat 付きは,今まで NIS を使った時のような
感じで運用する物だと個人的には思っています.
# man にも近いような事が書かれていたので,大きく外していないと
# 思います.

と言う事で,LDAP 参照に行っていないから id で引けないだけかと
思います.


nss_ldap の Couldn't search LDAP [server name] is unavailable ですが,
自分も解決したいと思って友人に色々調べてもらっていたのですが,
nss_ldap というより libldap が返しているようです.

とはいえ,nss_ldap が絡む部分以外にこのメッセージが出る事も無いので,
nss_ldap の挙動が怪しいのでは? と思うのですが…

nss_ldap.conf に nss_connecy_policy oneshot を入れる事で軽減は出来た
のですが,完全に潰せてはいない状態です.


メッセージは出ても実害は出ていないので無視する事にしているのですが,
この辺りの解決が出来ている方がいらっしゃったら,助けて頂ければ…
と,便乗したいと思います.


On Mon, 06 Apr 2009 15:59:30 +0900
野村 <nom...@ir-alt.co.jp> wrote:

> 野村と申します。
> 
> 「nss_ldap Couldn't search LDAP server.Server is unavailable」
> というメッセージは/etcのnsswitch.confにldapのエントリを追加して
> からでるようになったようです。
> 
> #
> # nsswitch.conf(5) - name service switch configuration file
> # $FreeBSD: src/etc/nsswitch.conf,v 1.1 2006/05/03 15:14:47 ume Exp $
> #
> group: files ldap
> group_compat: nis
> hosts: files dns ldap
> networks: files
> passwd: files ldap
> passwd_compat: nis
> shells: files
> services: compat
> services_compat: nis
> protocols: files
> rpc: files
> 
> 上記の
> passwd: files ldap
> passwd_compat: nis
> を
> passwd: files
> passwd_compat: nis ldap
> とするとnss-ldapのメッセージはでなくなりますが、今度は"id test3"
> 等として、ldapで追加したユーザをテストした時に"id: test3: no such
> user"といわれてしまいます。
> 
> また、test3ユーザでログインしようとした時に、パスワードの入力をして
> も受け付けてくれません。ユーザはphpldapadminで作っているのですが、
> 何が悪いのでしょうか?
> 
> よろしくお願いします。
> 
> On Mon, 06 Apr 2009 14:19:51 +0900
> 野村 <nom...@ir-alt.co.jp> wrote:
> 
> > 返信ありがとうございます。
> > 
> > それぞれ下記のようになっております。
> > 
> > ###nss-ldap.conf###
> > host hagi.hoge
> > base dc=hoge
> > uri ldap://hagi.hoge/
> > port 389
> > bind_policy soft
> > nss_connect_policy oneshot
> > 
> > ###ldap.conf###
> > BASE    dc=hoge
> > URI     ldap://hagi.hoge 389
> > 
> > SIZELIMIT       12
> > TIMELIMIT       15
> > DEREF           never
> > 
> > ###slapd.conf
> > include         /usr/local/etc/openldap/schema/core.schema
> > include         /usr/local/etc/openldap/schema/corba.schema
> > include         /usr/local/etc/openldap/schema/cosine.schema
> > include         /usr/local/etc/openldap/schema/inetorgperson.schema
> > include         /usr/local/etc/openldap/schema/nis.schema
> > include         /usr/local/etc/openldap/schema/openldap.schema
> > 
> > pidfile         /var/run/openldap/slapd.pid
> > argsfile        /var/run/openldap/slapd.args
> > 
> > modulepath      /usr/local/libexec/openldap
> > moduleload      back_bdb
> > 
> > access to attrs=userPassword
> >         by self write
> >         by users read
> >         by anonymous auth
> > 
> > access to *
> >         by self write
> >         by users read
> >         by anonymous read
> > 
> > database        bdb
> > suffix          "dc=hoge"
> > rootdn          "cn=ldaproot,dc=hoge"
> > rootpw          {SSHA}password
> > 
> > directory       /var/db/openldap-data
> > 
> > index   objectClass     eq
> > 
> > 返事がおくれてすいません。よろしくお願いします。
> > 
> > On Fri, 3 Apr 2009 22:53:21 +0900
> > Kouichiro Iwao <m...@club.kyutech.ac.jp> wrote:
> > 
> > > 岩男です。
> > > 
> > > On Fri, Apr 03, 2009 at 05:23:44PM +0900, 野村 wrote:
> > > > 野村と申します。
> > > > 
> > > > ldapを導入しようとしてるのですが、slapd を起動する時に「nss_ldap
> > > > Couldn't search LDAP server.Server is unavailable」と出てしまい、困って
> > > > おります。
> > > 
> > > ひとまず、
> > > /usr/local/etc/{nss_ldap.conf,ldap.conf,}
> > > /usr/local/etc/openldap/slapd.conf
> > > 
> > > の設定内容を明かしてください。


メールによる返信