From 1f2da037f06adc5e03b674cc57389d0ee7b30072 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Wed, 1 Feb 2012 12:33:09 +0100 Subject: [PATCH] Handle slapd config upgrade. --- files/etc/default/slapd.expect | 46 +++++++++++++++++++++++++++++++++++++++ files/etc/default/slapd.restore | 45 ++++++++++++++++++++++++++++++++++++++ src/functions.sh | 4 ++++ 3 files changed, 95 insertions(+) create mode 100644 files/etc/default/slapd.expect create mode 100644 files/etc/default/slapd.restore diff --git a/files/etc/default/slapd.expect b/files/etc/default/slapd.expect new file mode 100644 index 0000000..9cdf1c3 --- /dev/null +++ b/files/etc/default/slapd.expect @@ -0,0 +1,46 @@ +# Default location of the slapd.conf file. If empty, use the compiled-in +# default (/etc/ldap/slapd.conf). If using the cn=config backend to store +# configuration in LDIF, set this variable to the directory containing the +# cn=config data. +SLAPD_CONF= + +# System account to run the slapd server under. If empty the server +# will run as root. +SLAPD_USER="openldap" + +# System group to run the slapd server under. If empty the server will +# run in the primary group of its user. +SLAPD_GROUP="openldap" + +# Path to the pid file of the slapd server. If not set the init.d script +# will try to figure it out from $SLAPD_CONF (/etc/ldap/slapd.conf by +# default) +SLAPD_PIDFILE= + +# slapd normally serves ldap only on all TCP-ports 389. slapd can also +# service requests on TCP-port 636 (ldaps) and requests via unix +# sockets. +# Example usage: +# SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///" + +# If SLAPD_NO_START is set, the init script will not start or restart +# slapd (but stop will still work). Uncomment this if you are +# starting slapd via some other means or if you don't want slapd normally +# started at boot. +#SLAPD_NO_START=1 + +# If SLAPD_SENTINEL_FILE is set to path to a file and that file exists, +# the init script will not start or restart slapd (but stop will still +# work). Use this for temporarily disabling startup of slapd (when doing +# maintenance, for example, or through a configuration management system) +# when you don't want to edit a configuration file. +SLAPD_SENTINEL_FILE=/etc/ldap/noslapd + +# For Kerberos authentication (via SASL), slapd by default uses the system +# keytab file (/etc/krb5.keytab). To use a different keytab file, +# uncomment this line and change the path. +#export KRB5_KTNAME=/etc/krb5.keytab + +# Additional options to pass to slapd +SLAPD_OPTIONS="" +SLURPD_START=auto diff --git a/files/etc/default/slapd.restore b/files/etc/default/slapd.restore new file mode 100644 index 0000000..e1f5539 --- /dev/null +++ b/files/etc/default/slapd.restore @@ -0,0 +1,45 @@ +# Default location of the slapd.conf file. If empty, use the compiled-in +# default (/etc/ldap/slapd.conf). If using the cn=config backend to store +# configuration in LDIF, set this variable to the directory containing the +# cn=config data. +SLAPD_CONF= + +# System account to run the slapd server under. If empty the server +# will run as root. +SLAPD_USER="openldap" + +# System group to run the slapd server under. If empty the server will +# run in the primary group of its user. +SLAPD_GROUP="openldap" + +# Path to the pid file of the slapd server. If not set the init.d script +# will try to figure it out from $SLAPD_CONF (/etc/ldap/slapd.conf by +# default) +SLAPD_PIDFILE= + +# slapd normally serves ldap only on all TCP-ports 389. slapd can also +# service requests on TCP-port 636 (ldaps) and requests via unix +# sockets. +# Example usage: +# SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///" + +# If SLAPD_NO_START is set, the init script will not start or restart +# slapd (but stop will still work). Uncomment this if you are +# starting slapd via some other means or if you don't want slapd normally +# started at boot. +#SLAPD_NO_START=1 + +# If SLAPD_SENTINEL_FILE is set to path to a file and that file exists, +# the init script will not start or restart slapd (but stop will still +# work). Use this for temporarily disabling startup of slapd (when doing +# maintenance, for example, or through a configuration management system) +# when you don't want to edit a configuration file. +SLAPD_SENTINEL_FILE=/etc/ldap/noslapd + +# For Kerberos authentication (via SASL), slapd by default uses the system +# keytab file (/etc/krb5.keytab). To use a different keytab file, +# uncomment this line and change the path. +#export KRB5_KTNAME=/etc/krb5.keytab + +# Additional options to pass to slapd +SLAPD_OPTIONS="" diff --git a/src/functions.sh b/src/functions.sh index a223c8a..94db9b0 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -733,6 +733,10 @@ restore_configs () { restore_file /etc/issue.net fi + if pkg slapd lt 2.4.23-7.2; then + restore_file /etc/default/slapd + fi + # dovecot won't start with these options if pkg dovecot-cn && pkg dovecot-common lt 1:1.2.15-7; then sed -i 's/^\( *\)\(sieve\(_storage\)\?=.*\)/\1#\2/' \ -- 1.7.10.4