aboutsummaryrefslogtreecommitdiff
path: root/debian/anastasis-httpd.preinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/anastasis-httpd.preinst')
-rw-r--r--debian/anastasis-httpd.preinst29
1 files changed, 29 insertions, 0 deletions
diff --git a/debian/anastasis-httpd.preinst b/debian/anastasis-httpd.preinst
new file mode 100644
index 0000000..2d6c261
--- /dev/null
+++ b/debian/anastasis-httpd.preinst
@@ -0,0 +1,29 @@
1#!/bin/bash
2
3# We prevent a few questions from being asked
4# upon installation by specifying defaults. Namely,
5# we want the database to be accessed via Unix domain
6# sockets and password-less.
7
8set -e
9
10# When purging this package after the selections in the preinst have been made,
11# the debconf database is left in an inconsistent state and the package cannot
12# be installed again. This happens because dbconf-common will create a
13# template for these questions with a shared owner. Purging will only delete
14# one of the two templates, leading to a DB state where debconf-set-selections
15# fails. We work around this by manually fixing up the debconf database.
16#
17# Unfortunately we can't do this in "postrm", because during "postrm"
18# the configuration database is locked (even after db_stop).
19#
20# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487300
21if [ -x /usr/share/debconf/fix_db.pl ]; then
22 /usr/share/debconf/fix_db.pl || true
23fi
24
25echo anastasis-httpd anastasis-httpd/pgsql/method select Unix socket | debconf-set-selections
26echo anastasis-httpd anastasis-httpd/pgsql/authmethod-user select ident | debconf-set-selections
27echo anastasis-httpd anastasis-httpd/pgsql/app-pass password | debconf-set-selections
28
29exit 0