2

I am having a chicken and egg problem setting up ldap client on OmniOSCE, which is a Solaris fork.

Question

From what I can tell from the below, then ldap_client and ldap_cachemgr needs each other in order to work, which seams like a chicken and egg problem?

And is ldap_cachemgr suppose to be a service that should run?

Background

This is what I am doing

echo "xx.xx.xx.xx    ldap.example.com" >> /etc/hosts
domainname imm
domainname > /etc/defaultdomain

cp -a /etc/nsswitch.conf{,_orig}

ldapclient manual \
  -a domainName=dc=example.com -a credentialLevel=self \
  -a defaultSearchBase=dc=xxx,dc=example,dc=com \
  -a defaultServerList=ldap.example.com

echo "imm" > /etc/defaultdomain

/usr/bin/cp -f /etc/nsswitch.conf{_orig,}

replace_args () {
  perl -i -slpe 's/^$string\s+\K.*/$add/' -- -string="$1" -add="$2" "$3"
}

replace_args 'passwd:'   'files ldap' /etc/nsswitch.conf
replace_args 'group:'    'files ldap' /etc/nsswitch.conf
replace_args 'netgroup:' 'files ldap' /etc/nsswitch.conf
replace_args 'hosts:'    'files dns'  /etc/nsswitch.conf
replace_args 'ipnodes:'  'files dns'  /etc/nsswitch.conf

function delete_line { ( sed -i "/$1/d" $2 ) };
delete_line ldap.example.com /etc/hosts

svcadm enable svc:/network/ldap/client

# ldaplist -l netgroup
ldaplist: LDAP configuration problem (Unable to load configuration '/var/ldap/ldap_client_file' ('').)
/var/ldap/ldap_client_file is empty.

/var/adm/messages have

Apr 13 14:18:21 omniosce ldap_cachemgr[8369]: [ID 293258 daemon.error] libsldap: Status: 4  Mesg: Unable to open filename '/var/ldap/ldap_cl
ient_cred' for reading (errno=2).
Apr 13 14:18:21 omniosce ldap_cachemgr[8368]: [ID 703877 daemon.error] ldap_cachemgr: failed (rc = 255).
Apr 13 14:18:21 omniosce svc.startd[10]: [ID 652011 daemon.warning] svc:/network/ldap/client:default: Method "/lib/svc/method/ldap-client start" failed with exit status 1.
Apr 13 14:18:21 omniosce svc.startd[10]: [ID 748625 daemon.error] network/ldap/client:default failed: transitioned to maintenance (see 'svcs -xv' for details)
Apr 13 14:18:21 omniosce fmd: [ID 377184 daemon.error] SUNW-MSG-ID: SMF-8000-YX, TYPE: defect, VER: 1, SEVERITY: major
Apr 13 14:18:21 omniosce EVENT-TIME: Fri Apr 13 14:18:21 CEST 2018
Apr 13 14:18:21 omniosce PLATFORM: KVM, CSN: -, HOSTNAME: omniosce
Apr 13 14:18:21 omniosce SOURCE: software-diagnosis, REV: 0.1
Apr 13 14:18:21 omniosce EVENT-ID: 182b4afe-1cc8-68ea-8755-f9ee03c05462
Apr 13 14:18:21 omniosce DESC: A service failed - a method is failing in a retryable manner but too often.
Apr 13 14:18:21 omniosce   Refer to http://illumos.org/msg/SMF-8000-YX for more information.
Apr 13 14:18:21 omniosce AUTO-RESPONSE: The service has been placed into the maintenance state.
Apr 13 14:18:21 omniosce IMPACT: svc:/network/ldap/client:default is unavailable.
Apr 13 14:18:21 omniosce REC-ACTION: Run 'svcs -xv svc:/network/ldap/client:default' to determine the generic reason why the service failed, the location of any logfiles, and a list of other services impacted.
Apr 13 14:18:27 omniosce ldap_cachemgr[8484]: [ID 293258 daemon.error] libsldap: Status: 4  Mesg: Unable to open filename '/var/ldap/ldap_client_cred' for reading (errno=2).
Apr 13 14:18:27 omniosce ldap_cachemgr[8483]: [ID 703877 daemon.error] ldap_cachemgr: failed (rc = 255).
Apr 13 14:18:27 omniosce svc.startd[10]: [ID 652011 daemon.warning] svc:/network/ldap/client:default: Method "/lib/svc/method/ldap-client start" failed with exit status 1.
Apr 13 14:18:27 omniosce svc.startd[10]: [ID 748625 daemon.error] network/ldap/client:default failed: transitioned to maintenance (see 'svcs -xv' for details)
Apr 13 14:18:27 omniosce fmd: [ID 377184 daemon.error] SUNW-MSG-ID: SMF-8000-YX, TYPE: defect, VER: 1, SEVERITY: major
Apr 13 14:18:27 omniosce EVENT-TIME: Fri Apr 13 14:18:27 CEST 2018

svcs -xv svc:/network/ldap/client:default have

svc:/network/ldap/client:default (LDAP client)
 State: maintenance since 13 April 2018 14:18:27 CEST
Reason: Start method failed repeatedly, last exited with status 1.
   See: http://illumos.org/msg/SMF-8000-KS
   See: man -M /usr/share/man -s 1M ldap_cachemgr
   See: /var/svc/log/network-ldap-client:default.log
Impact: This service is not running.

I have even tried to copy /var/ldap/ldap_client_file from a working test installation, where I somehow got it to work, but can't reproduce it.

# svcadm restart svc:/network/ldap/client
# ldaplist -l netgroup
ldaplist: LDAP configuration problem (Unable to load configuration '/var/ldap/ldap_client_file' ('').)

For some reason it doesn't see /var/ldap/ldap_client_file now exists.

There doesn't seams to be a caching service running

# svcs|grep cache
online         14:18:28 svc:/system/name-service-cache:default
Sandra
  • 9,973
  • 37
  • 104
  • 160

1 Answers1

4

ldap_cachemgr is the ldap client on Solaris and yes it must keep always running as a service.

To configure the ldap client you need two files under /var/ldap:

  • ldap_client_cred
  • ldap_client_file

ldap_client_cred contain the credentials of the proxy user, something like this:

NS_LDAP_BINDDN= cn=proxyagent,ou=Profile,dc=example,dc=com 
NS_LDAP_BINDPASSWD= {NS1}47c4213f9c248484454e6782 

ldap_client_file contain the directives to connect to your ldap server:

NS_LDAP_FILE_VERSION= 2.0
NS_LDAP_SERVERS= SERVER_LDAP
NS_LDAP_SEARCH_BASEDN= dc=example,dc=com
NS_LDAP_AUTH= simple
NS_LDAP_SEARCH_REF= FALSE
NS_LDAP_SEARCH_SCOPE= one
NS_LDAP_SEARCH_TIME= 30
NS_LDAP_SERVER_PREF= SERVER_LDAP
NS_LDAP_PROFILE= my_profile
NS_LDAP_CREDENTIAL_LEVEL= proxy
NS_LDAP_BIND_TIME= 10
NS_LDAP_SERVICE_AUTH_METHOD= pam_ldap:simple

my_profile must be loaded on your ldap server.

Last step is include ldap on nsswitch.conf and start the client.

Daniel PC
  • 86
  • 4