#!/bin/sh -e create_systemd_units() { # Enable the extra instances on new installs and on upgrades from # pre-systemd versions. if [ "$2" ] && dpkg --compare-versions $2 ge 0.999~20180516-1; then return fi [ -e /etc/default/rbldnsd ] || return 0 . /etc/default/rbldnsd local list="$(echo "$RBLDNSD" | egrep '^[A-Za-z0-9]+ ' | sed -re 's/ .+//')" for instance in $list; do echo "Enabling instance $instance." [ -e /etc/systemd/system/multi-user.target.wants/rbldnsd@${instance}.service ] || \ ln -s /lib/systemd/system/rbldnsd@.service /etc/systemd/system/multi-user.target.wants/rbldnsd@${instance}.service invoke-rc.d rbldnsd@${instance} start done return } create_user() { if getent passwd rbldns >/dev/null; then return fi adduser --system --group --home /var/lib/rbldns --no-create-home rbldns mkdir -p -m0755 /var/lib/rbldns } case "$1" in configure) create_user create_systemd_units "$@" ;; esac # Automatically added by dh_installsysusers/13.15.2 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then systemd-sysusers ${DPKG_ROOT:+--root="$DPKG_ROOT"} rbldnsd.conf fi # End automatically added section # Automatically added by dh_installinit/13.15.2 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/rbldnsd" ]; then update-rc.d rbldnsd defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native rbldnsd $_dh_action || exit 1 fi fi # End automatically added section # Automatically added by dh_installsystemd/13.15.2 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'rbldnsd.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'rbldnsd.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'rbldnsd.service' >/dev/null || true else # 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 'rbldnsd.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.15.2 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'rbldnsd.socket' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'rbldnsd.socket'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'rbldnsd.socket' >/dev/null || true else # 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 'rbldnsd.socket' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.15.2 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 'rbldnsd.service' 'rbldnsd.socket' >/dev/null || true fi fi # End automatically added section