process.sh 722 B

12345678910111213141516
  1. #!/bin/bash -e
  2. # set -x (bash debug) if log level is trace
  3. # https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/log-helper
  4. log-helper level eq trace && set -x
  5. # Reduce maximum number of number of open file descriptors to 1024
  6. # otherwise slapd consumes two orders of magnitude more of RAM
  7. # see https://github.com/docker/docker/issues/8231
  8. ulimit -n $LDAP_NOFILE
  9. # Call hostname to determine the fully qualified domain name. We want OpenLDAP to listen
  10. # to the named host for the ldap:// and ldaps:// protocols.
  11. FQDN="$(/bin/hostname --fqdn)"
  12. HOST_PARAM="ldap://$FQDN:$LDAP_PORT ldaps://$FQDN:$LDAP_PORT"
  13. exec /usr/sbin/slapd -h "$HOST_PARAM ldapi:///" -u openldap -g openldap -d "$LDAP_LOG_LEVEL"