diff --git a/debian/postinst b/debian/postinst index 2f8f18e813b..5126df0cf79 100644 --- a/debian/postinst +++ b/debian/postinst @@ -13,8 +13,8 @@ case "${1}" in if ! getent passwd | grep -q "^odoo:"; then adduser --system --home $ODOO_DATA_DIR --quiet --group $ODOO_USER fi - # Register "$ODOO_USER" as a postgres superuser - su - postgres -c "createuser -s $ODOO_USER" 2> /dev/null || true + # Register "$ODOO_USER" as a postgres user with "Create DB" role attribute + su - postgres -c "createuser -d -R -S $ODOO_USER" 2> /dev/null || true # Configuration file chown $ODOO_USER:$ODOO_GROUP $ODOO_CONFIGURATION_FILE chmod 0640 $ODOO_CONFIGURATION_FILE diff --git a/setup/redhat/postinstall.sh b/setup/redhat/postinstall.sh index 04ea928b13a..b9ef1f908e0 100644 --- a/setup/redhat/postinstall.sh +++ b/setup/redhat/postinstall.sh @@ -13,8 +13,8 @@ if ! getent passwd | grep -q "^odoo:"; then groupadd $ODOO_GROUP adduser --system --no-create-home $ODOO_USER -g $ODOO_GROUP fi -# Register "$ODOO_USER" as a postgres superuser -su - postgres -c "createuser -s $ODOO_USER" 2> /dev/null || true +# Register "$ODOO_USER" as a postgres user with "Create DB" role attribute +su - postgres -c "createuser -d -R -S $ODOO_USER" 2> /dev/null || true # Configuration file mkdir -p $ODOO_CONFIGURATION_DIR # can't copy debian config-file as addons_path is not the same