Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slapd does not start when already configured #23

Open
muellermartin opened this issue Jul 3, 2017 · 1 comment
Open

slapd does not start when already configured #23

muellermartin opened this issue Jul 3, 2017 · 1 comment

Comments

@muellermartin
Copy link

muellermartin commented Jul 3, 2017

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.

@muellermartin
Copy link
Author

As a temporary workaround -e SLAPD_= can be passed to the docker run command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant