ltb-project / openldap-deb

Debian packages for OpenLDAP
http://ltb-project.org/wiki/documentation/openldap-deb
GNU General Public License v3.0
14 stars 13 forks source link

issue with Debian Stretch postinst when attempting to build a Docker image #30

Closed fred49 closed 2 years ago

fred49 commented 5 years ago

Hi, I'm trying to build a docker image using OpenLDAP LTB project and I have an issue with the postinst script. It requires to have systemctl installed. I don't want to compile openldap, I want reuse Debian packages even if it is no perfect. So is it possible to test if systemctl exists and then call it ?

Fred.

davidcoutadeur commented 5 years ago

Hi, The best way would be to call the slapd-cli script from postinst.

  1. slapd-cli is always present
  2. anyway, systemd script is calling slapd-cli, so it is more efficient to call slapd-cli directly.

-> TODO

fmartin-linagora commented 5 years ago

Hi, sorry but you can't use your solution because you still have to enable your service. Cf current lines of code :

systemctl enable slapd || exit $?
systemctl start slapd || exit $?
davidcoutadeur commented 5 years ago

Hi @fmartin-linagora The solution I propose:

if systemd available: keep the current behaviour else: start process with slapd-cli, but don't set "start on boot"

davidcoutadeur commented 5 years ago

As discussed, the better for docker is not to start OpenLDAP. So:

if systemd available: keep the current behaviour
else: do nothing (don't start on boot, don't start slapd-cli now)
davidcoutadeur commented 5 years ago

Also, another improvement is to check the presence of rsyslog before configuring the logs.

davidcoutadeur commented 5 years ago

Done in https://github.com/ltb-project/openldap-deb/releases/tag/v2.4.48

davidcoutadeur commented 3 years ago

Error reproduced installing with docker:

-> Investigate the problem -> see if this is specific to debian, else reopen issue in rpm repository

davidcoutadeur commented 2 years ago

New tests on docker + OpenLDAP 2.5 show no problem

See #71