NoBeoKa's picture

I've been trying to deploy Docker TKL/OpenLdap in my environment, and have found that I am not able to maintain the persistent data.

I work around this by extending the docker image with Dockerfile, and adding a volume for the /var/lib/ldap path, as that's where the DB is stored.

However, after a stop-start on the container, all data gets wiped out.

It appears that each time the container starts, the script initialises a new instance of DB for OpenLdap, regardless of whether its a new container or old container.

Am I missing some parameters, or is this a bug in the /usr/sbin/ script? 

Jeremy Davis's picture

Apologies on my slow response.

TBH, I don't have a ton of experience with our Docker builds, although your experience doesn't sound right.

My only thought is perhaps it's not completing the initialisation properly?! FWIW the TurnKey Docker docs cover how that should work (i.e. the 2 options; preseeded or interactive).

NoBeoKa's picture

So I've actually read the documentation (must have been more than 10 times by now) in detail.

I've also tried the pre-seeded option multiple times. As per each time, I still cannot get it to work.

The issue here is, in the pre-seeded configuration, there is this line in the documentation: "The appliance will initialize itself with the provided configuration. Once initialized, the configuration will be deleted."

I look at this preseeded inithook.conf file multiple times, but the configuration was not deleted after initialization. 

I wonder if that was an issue, so I manually delete it after the first boot. Then, I realise it broke the phpldapadmin installation.

I'm now beginning to wonder if this is actually a bug or something. Considering for openldap-tkl, there are actually 2 applications running. openldap itself, and phpldapadmin. This seems to be complicating initialisation.

Jeremy Davis's picture

FWIW it's the contents /etc/inithook.conf that should be deleted, not the file itself. So if the initial config completes, then the file should still be there, but it should be empty.

If it still contains your initial config, then that would suggest that my initial concern (that something is going wrong with the initialisation) is correct. Exactly what that might be though would require some closer inspection, probably the first place to start would be the log file, IIRC that should be /var/log/inithooks.log.

As I noted, I'm not that familiar with Docker, but I think that there's a command to get the container logs externally. Either way, if you can share the start up logs of your container, I suspect that may give some more insight.

Add new comment