2 # citadel-server.postinst
3 # by Wilfried Goesgens & Fathi Boudra
8 . /usr/share/debconf/confmodule
14 if ! getent group citadel >/dev/null; then
17 if ! getent passwd citadel >/dev/null; then
18 adduser --system --ingroup citadel --home /var/lib/citadel \
19 --gecos "Citadel system user" --shell /bin/sh \
20 --disabled-password citadel
22 chown -R citadel:citadel /etc/citadel
23 chown -R citadel:citadel /var/lib/citadel /var/spool/citadel
25 # we're a bit paranoid here, because of this gave us many errors in the past.
26 chown root:root /usr/sbin/chkpwd
27 chmod 4755 /usr/sbin/chkpwd
29 db_get citadel/Administrator && admin="$RET"
30 db_get citadel/ServerIPAddress && ip_addr="$RET"
31 db_get citadel/LoginType && enable_unix_auth="$RET"
32 if test "$enable_unix_auth" = "true"; then
33 export ENABLE_UNIX_AUTH=yes
35 export ENABLE_UNIX_AUTH=no
37 export IP_ADDR=$ip_addr
39 export CITADEL_INSTALLER=yes
41 export SYSADMIN_NAME=$admin
42 export CREATE_XINETD_ENTRY=no
43 export CREATE_INITTAB_ENTRY=no
44 export NO_INIT_SCRIPTS=yes
46 echo "applying your settings."
47 /usr/lib/citadel-server/setup -q
49 if test -S /var/run/citadel/citadel.socket; then
50 /usr/sbin/sendcommand "DOWN"
53 while test -S /var/run/citadel/citadel.socket; do
60 abort-upgrade|abort-remove|abort-deconfigure)
63 *) echo "$0: didn't understand being called with \`$1'" 1>&2