Skip to content

slapd does not start when already configured #23

Open
@muellermartin

Description

I just found a bug when starting the container with an already configured slapd and prepopulated database e.g. by running the container with this command on pre-existing etc and lib folder:

docker run -d -p 389:389 --name ldap -v $PWD/etc:/etc/ldap -v $PWD/lib:/var/lib/ldap dinkel/openldap

docker ps -a returns this line for the started container (exit status 1):

77b130e80a2c        dinkel/openldap            "/entrypoint.sh sl..."   18 seconds ago      Exited (1) 18 seconds ago                            ldap

docker logs ldap returns nothing.

By debugging the entrypoint.sh shell script does exit at line 100:

slapd_configs_in_env=`env | grep 'SLAPD_'`

Due to setting set -e in line 8 and due to the fact that grep exits with a non-zero exit status when it does not find the search pattern, the script exits prematurely and does not proceed to the call of exec.

As a fix I suggest appending true to the subshell expression in line 100 like this:

slapd_configs_in_env=`env | grep 'SLAPD_' | true`

I will prepare a PR shortly for this. Edit: I saw there is already PR #18 which addresses this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions