case "$1" in
configure)
+ echo "$2"
#Don't create users on upgrade
if [ -z "$2" ]; then
# Don't fail if the user/database already exists
su postgres -c 'createuser invirt -S -d -R' || true
su postgres -c 'createdb invirt -O invirt' || true
- adduser --system invirt
fi
+
+ # The invirt user *must* exist
+ if [ -z `getent passwd invirt` ]; then
+ adduser --system invirt
+ fi
invoke-rc.d postgresql-8.3 restart
su invirt -s /bin/sh -c 'invirt-database-tables create'
;;