From 4a8c77495f576c8d830b0822807950d38ee5e447 Mon Sep 17 00:00:00 2001 From: Greg Brockman Date: Thu, 24 Dec 2009 19:00:01 -0500 Subject: [PATCH] Make invirt-database-server.postinst check whether the invirt user actually exists svn path=/trunk/packages/invirt-database/; revision=2781 --- debian/changelog | 6 ++++++ debian/invirt-database-server.postinst | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 51abf14..dde051e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-database (0.2.3) unstable; urgency=low + + * Test whether invirt user exists in postinst + + -- Greg Brockman Thu, 24 Dec 2009 18:58:32 -0500 + invirt-database (0.2.2) unstable; urgency=low * Add builds table for storing build history. diff --git a/debian/invirt-database-server.postinst b/debian/invirt-database-server.postinst index 79fe70c..86bc5d8 100644 --- a/debian/invirt-database-server.postinst +++ b/debian/invirt-database-server.postinst @@ -28,13 +28,18 @@ set -e 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' ;; -- 1.7.9.5