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

Bootstrap script breaks due to non-set environment variables #49

Closed
IngmarPaetzold opened this issue Sep 12, 2023 · 0 comments
Closed

Comments

@IngmarPaetzold
Copy link
Contributor

After building the container locally, I had the same issue as #42 and could solve that with https://github.com/jskacel 's proposal:
https://github.com/rroemhild/docker-test-openldap/blob/master/rootfs/opt/openldap/bootstrap/config/tls.ldif#L3-L5

However, the script broke again:

Load data...
++ find /opt/openldap/bootstrap/data -maxdepth 1 -name '*_*.ldif' -type f
++ sort
Processing file /opt/openldap/bootstrap/data/00_people.ldif...
[...]
/opt/openldap/bootstrap/data/30_groups_crew.ldif'
+ for ldif in ${data}
+ echo 'Processing file /opt/openldap/bootstrap/data/00_people.ldif...'
/var/run/s6/etc/cont-init.d/050-openldap-populate: line 43: LDAP_BASEDN: unbound variable
[cont-init.d] 050-openldap-populate: exited 1.
[cont-init.d] done.
[services.d] starting services
starting slapd
[services.d] done.
65002ed6 @(#) $OpenLDAP: slapd  (May 14 2022 18:35:44) $
        Debian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>
65002ed6 hdb_db_open: database "dc=planetexpress,dc=com": database already in use.
65002ed6 backend_startup_one (type=hdb, suffix="dc=planetexpress,dc=com"): bi_db_open failed! (-1)
65002ed6 slapd stopped.

It fails because variables LDAP_BASEDN and LDAP_DOMAIN are not set, but script /rootfs/etc/cont-init.d/050-openldap-populate references them.
Reason is the set -eux on top which makes every non-set variable an error.

Therefore the script breaks and does not stop the database, which, as consequence, raises the database already in use error.

I will file a pull request for that.

rroemhild added a commit that referenced this issue Sep 16, 2023
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