Index: openacs-dist/debian/debian/DEBIAN/postinst =================================================================== RCS file: /usr/local/cvsroot/openacs-dist/debian/debian/DEBIAN/postinst,v diff -u -N -r1.4 -r1.5 --- openacs-dist/debian/debian/DEBIAN/postinst 20 Oct 2006 20:12:07 -0000 1.4 +++ openacs-dist/debian/debian/DEBIAN/postinst 20 Oct 2006 22:21:58 -0000 1.5 @@ -1,5 +1,8 @@ #!/bin/sh +#--------------config +DOTLRN_USER=dotlrn + echo "Shutting down aolserver" /etc/init.d/aolserver4 stop # make sure nsd is really gone @@ -8,10 +11,17 @@ echo "Remove the dummy files from debian's stock aolserver installation" rm -rf /var/www/index.html /var/www/icons -echo "Create the www-data user in Postgres and the dotlrn database." -su - postgres "dropuser www-data" +if ! grep -q ^$DOTLRN_USER /etc/passwd; then + echo "Adding $DOTLRN_USER user and group" + adduser --system --group $DOTLRN_USER +fi + +chown -R dotlrn:dotlrn /var/www/* + +echo "(Re)create the $DOTLRN_USER user in Postgres and the dotlrn database." +su - postgres "dropuser dotlrn" su - postgres "dropdb dotlrn" -su - postgres "createuser -a -d www-data" +su - postgres "createuser -a -d dotlrn" su - postgres "createdb -E UNICODE dotlrn" su - postgres "createlang plpgsql dotlrn"