#!/bin/sh set -e . /usr/share/debconf/confmodule CONFIG_DIR=/etc/dirsrv OUT=/dev/null INSTANCES=`ls -d /etc/dirsrv/slapd-* 2>/dev/null | grep -v removed | sed 's/.*slapd-//'` if [ "$1" = configure ]; then # lets give them a user/group in all cases. if ! getent passwd dirsrv > $OUT; then adduser --quiet --system --home /var/lib/dirsrv \ --disabled-password --group \ --gecos "389 Directory Server user" \ --no-create-home \ dirsrv > $OUT fi chown -R dirsrv:dirsrv /etc/dirsrv/ /var/log/dirsrv/ /var/lib/dirsrv/ > $OUT || true chmod 750 /etc/dirsrv/ /var/log/dirsrv/ /var/lib/dirsrv/ > $OUT || true fi invoke_failure() { # invoke-rc.d failed, likely because no instance has been configured yet # but exit with an error if an instance is configured and the invoke failed if [ -z $INSTANCES ]; then echo "... because no instance has been configured yet." else exit 1 fi } # Automatically added by dh_installsystemd/13.15.3 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if deb-systemd-helper debian-installed 'dirsrv-snmp.service'; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'dirsrv-snmp.service' >/dev/null || true if deb-systemd-helper --quiet was-enabled 'dirsrv-snmp.service'; then # Create new symlinks, if any. deb-systemd-helper enable 'dirsrv-snmp.service' >/dev/null || true fi fi # Update the statefile to add new symlinks (if any), which need to be cleaned # up on purge. Also remove old symlinks. deb-systemd-helper update-state 'dirsrv-snmp.service' >/dev/null || true fi # End automatically added section # Automatically added by dh_installsystemd/13.15.3 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'dirsrv-snmp.service' >/dev/null || true fi fi # End automatically added section