aboutsummaryrefslogtreecommitdiff
path: root/debian/taler-exchange.postinst
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-01-01 22:12:59 +0100
committerChristian Grothoff <christian@grothoff.org>2021-01-01 22:12:59 +0100
commitfbc0542e0c4051897615c881a2a134079be61e2f (patch)
tree56ace78535d3f5ad6c4b8bfc838f0b1c222930b2 /debian/taler-exchange.postinst
parente4dc1ecc5d036d9fad73605ce86c30af0574a32a (diff)
modify setup to not do DB, cannot be fully done anyway
Diffstat (limited to 'debian/taler-exchange.postinst')
-rw-r--r--debian/taler-exchange.postinst58
1 files changed, 16 insertions, 42 deletions
diff --git a/debian/taler-exchange.postinst b/debian/taler-exchange.postinst
index 8256e886a..e2b2ab310 100644
--- a/debian/taler-exchange.postinst
+++ b/debian/taler-exchange.postinst
@@ -55,13 +55,19 @@ case "${1}" in
CONFIG_FILE="/etc/default/taler-exchange"
TALER_HOME="/var/lib/taler-exchange"
- # Creating taler group if needed
+ # Creating taler groups as needed
if ! getent group ${_GROUPNAME} > /dev/null
then
echo -n "Creating new Taler group ${_GROUPNAME}:"
addgroup --quiet --system ${_GROUPNAME}
echo " done."
fi
+ if ! getent group ${_DBGROUPNAME} > /dev/null
+ then
+ echo -n "Creating new Taler group ${_DBGROUPNAME}:"
+ addgroup --quiet --system ${_DBGROUPNAME}
+ echo " done."
+ fi
# Creating taler users if needed
if ! getent passwd ${_EUSERNAME} > /dev/null
@@ -87,14 +93,14 @@ case "${1}" in
then
echo -n "Creating new Taler user ${_WIREUSERNAME}:"
adduser --quiet --system --home ${TALER_HOME}/wire ${_WIREUSERNAME}
- adduser ${_WIREUSERNAME} ${_DBGROUPNAME}
+ adduser --quiet ${_WIREUSERNAME} ${_DBGROUPNAME}
echo " done."
fi
if ! getent passwd ${_AGGRUSERNAME} > /dev/null
then
echo -n "Creating new Taler user ${_AGGRUSERNAME}:"
adduser --quiet --system --home ${TALER_HOME}/aggregator ${_AGGRUSERNAME}
- adduser ${_AGGRUSERNAME} ${_DBGROUPNAME}
+ adduser --quiet ${_AGGRUSERNAME} ${_DBGROUPNAME}
echo " done."
fi
@@ -194,58 +200,26 @@ Restart=on-failure
ExecStart=/usr/bin/taler-exchange-aggregator -c /etc/taler.conf
EOF
- systemctl daemon-reload
-
cp -f "${CONFIG_NEW}" "${CONFIG_FILE}"
+ rm -f "${CONFIG_NEW}"
echo " done."
+ echo -n "Setting up system services "
+
mkdir -p /var/lib/taler-exchange/tmp
- chown root:taler /var/lib/taler-exchange/tmp
+ chown root:${_GROUPNAME} /var/lib/taler-exchange/tmp
chmod 770 /var/lib/taler-exchange/tmp
chmod +s /var/lib/taler-exchange/tmp
- # Setup postgres database (needs dbconfig-pgsql package)
- if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
- . /usr/share/dbconfig-common/dpkg/postinst.pgsql
- # dbc_dbfile_* should not apply for Postgres, but better be safe...
- dbc_dbfile_owner="${_EUSERNAME}:${_DBGROUPNAME}"
- dbc_dbfile_perms="0660"
- dbc_pgsql_createdb_encoding="UTF8"
- dbc_go taler-exchange "$@"
- fi
- # get database settings from dbconfig-common
- if [ -f /etc/dbconfig-common/taler-exchange.conf ]; then
- . /etc/dbconfig-common/taler-exchange.conf
- case "$dbc_dbtype" in
- pgsql)
- taler-config -c /etc/taler-exchange-db.conf \
- -s "exchangedb-postgres" \
- -o "CONFIG" \
- -V "postgres://$dbc_dbuser:$dbc_dbpass@$dbc_dbserver/$dbc_dbname"
- taler-config -c /etc/taler-exchange-db.conf \
- -s "exchange" \
- -o "DB" \
- -V "postgres"
- chown ${_EUSERNAME}:${_DBGROUPNAME} /etc/taler-exchange-db.conf
- chmod 440 /etc/taler-exchange-db.conf
- ;;
- "")
- ;;
- *)
- echo "Unsupported database type $dbc_type."
- exit 1
- ;;
- esac
- fi
+ systemctl daemon-reload
+
+ echo "done."
# Cleaning
- rm -f "${CONFIG_NEW}"
echo "All done."
-
;;
abort-upgrade|abort-remove|abort-deconfigure)
-
;;
*)