summaryrefslogtreecommitdiffstats
path: root/debian/kea-common.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/kea-common.postinst')
-rw-r--r--debian/kea-common.postinst39
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/kea-common.postinst b/debian/kea-common.postinst
new file mode 100644
index 0000000..61957be
--- /dev/null
+++ b/debian/kea-common.postinst
@@ -0,0 +1,39 @@
+#!/bin/sh
+# postinst script for kea-common
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+ configure)
+ addgroup --force-badname --system _kea >/dev/null || exit 1
+ adduser --force-badname --quiet --system --home /var/lib/kea \
+ --shell /bin/false --no-create-home --disabled-password --disabled-login \
+ --gecos "Kea DHCP User" --group _kea >/dev/null || exit 1
+
+ # From version 2.2.0-2 we leave the handling of the /var/log/kea and
+ # /var/lib/kea directories to systemd (creation and ownership/permissions
+ # settings). When upgrading from kea-common (< 2.2.0-2) drop the now
+ # useless dpkg-statoverrides.
+ if [ "$2" != "" ] && dpkg --compare-versions "$2" lt "2.2.0-2"; then
+ for d in /var/log/kea /var/lib/kea; do
+ if dpkg-statoverride --list $d >/dev/null 2>&1; then
+ dpkg-statoverride --remove $d
+ fi
+ done
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0