SLAPD 的脚本安装

Script install for SLAPD

我正在开发 debian 8。 我希望使用脚本安装 slapd,而不需要来自终端的任何问题。 我试过了:

debconf-set-selections <<< 'slapd/root_password password 123123'
debconf-set-selections <<< 'slapd/root_password_again 123123'
apt-get install slapd ldap-utils -y

但是系统问我ldap密码

我也希望使用 :

dpkg-reconfigure slapd

可能吗?

一般来说,如何找到安装过程中的所有问题以便使用 debconf-set-selections?

您似乎有多个错别字。第二行缺少 password 字段类型说明符,并且两行都缺少 slapd 包标识符。您可以使用 debconf-set-selections -c.

轻松诊断此问题

http://openstack.prov12n.com/quiet-or-unattended-installing-openldap-on-ubuntu-14-04/ 似乎有一个当前指令应该可以很好地工作。我既高兴又害怕地注意到字段名称也与您使用的名称不同。您使用的是完全不同的 slapd 包,还是只是猜测字段名称?

在你的脚本中尝试这样的事情:

echo 'slapd/root_password password password' | debconf-set-selections \
  && echo 'slapd/root_password_again password password' | debconf-set-selections \
  && echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

debconf-set-selections 的可能属性在 debian 软件包的 slapd.templates 文件中定义,连同配置属性的描述。

对于 Debian Jessie 上的 slapd,您可以在这里找到文件:https://anonscm.debian.org/cgit/pkg-openldap/openldap.git/tree/debian/slapd.templates?h=jessie