Index: openacs-dist/create-package.sh =================================================================== RCS file: /usr/local/cvsroot/openacs-dist/create-package.sh,v diff -u -r1.6 -r1.7 --- openacs-dist/create-package.sh 20 Oct 2006 20:22:31 -0000 1.6 +++ openacs-dist/create-package.sh 20 Oct 2006 22:21:58 -0000 1.7 @@ -15,8 +15,8 @@ chmod 755 debian/debian/DEBIAN/control debian/debian/DEBIAN/postinst debian/debian/DEBIAN/prerm chown -R root:root debian/debian/DEBIAN/control debian/debian/DEBIAN/postinst debian/debian/DEBIAN/prerm -echo "Setting OpenACS' ownership to www-data. We may want to set proper permissions here in the future." -chown -R www-data:www-data debian/debian/var/www +echo "Setting OpenACS' ownership to root data. The package's postinst script will set the owner to dotlrn." +chown -R root:root debian/debian/var/www rm debian/debian/var/www/put-your-distro-here echo "Building the debian package" Index: openacs-dist/debian/debian/DEBIAN/control =================================================================== RCS file: /usr/local/cvsroot/openacs-dist/debian/debian/DEBIAN/Attic/control,v diff -u -r1.1 -r1.2 --- openacs-dist/debian/debian/DEBIAN/control 12 Sep 2006 13:51:44 -0000 1.1 +++ openacs-dist/debian/debian/DEBIAN/control 20 Oct 2006 22:21:58 -0000 1.2 @@ -3,6 +3,6 @@ Section: web Priority: optional Architecture: i386 -Depends: aolserver4, aolserver4-nscache, aolserver4-nspostgres, aolserver4-nssha1, tdom, postgresql +Depends: aolserver4, aolserver4-nscache, aolserver4-nspostgres, aolserver4-nssha1, tdom, postgresql, adduser Maintainer: Dirk Gomez Description: .LRN 2.2.0 Index: openacs-dist/debian/debian/DEBIAN/postinst =================================================================== RCS file: /usr/local/cvsroot/openacs-dist/debian/debian/DEBIAN/postinst,v diff -u -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" Index: openacs-dist/debian/debian/DEBIAN/prerm =================================================================== RCS file: /usr/local/cvsroot/openacs-dist/debian/debian/DEBIAN/prerm,v diff -u -r1.3 -r1.4 --- openacs-dist/debian/debian/DEBIAN/prerm 20 Oct 2006 20:12:07 -0000 1.3 +++ openacs-dist/debian/debian/DEBIAN/prerm 20 Oct 2006 22:21:58 -0000 1.4 @@ -4,9 +4,10 @@ # make sure nsd is really gone pkill nsd -echo "Removing the www-data user in Postgres and the dotlrn database." -su - postgres "dropuser www-data" +echo "Removing the dotlrn user in the operating system, in Postgres and the dotlrn database." +su - postgres "dropuser dotlrn" su - postgres "dropdb dotlrn" +deluser dotlrn echo "Removing the dotlrn crontab jobs from postgres' crontab" su - postgres "crontab -l |grep -v dotlrn> /tmp/pgcrontab.$$; \ Index: openacs-dist/debian/debian/etc/aolserver4/dotlrn.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-dist/debian/debian/etc/aolserver4/dotlrn.tcl,v diff -u -r1.1 -r1.2 --- openacs-dist/debian/debian/etc/aolserver4/dotlrn.tcl 20 Oct 2006 20:12:08 -0000 1.1 +++ openacs-dist/debian/debian/etc/aolserver4/dotlrn.tcl 20 Oct 2006 22:21:58 -0000 1.2 @@ -41,7 +41,7 @@ } else { set db_host localhost set db_port 5432 - set db_user www-data + set db_user dotlrn } #--------------------------------------------------------------------- @@ -83,8 +83,8 @@ ns_param maxbackup 5 ns_param debug $debug # ns_param mailhost localhost - ns_param user www-data - ns_param group www-data + ns_param user dotlrn + ns_param group dotlrn # If setting port below 1024 with AOLServer 4, read comments in file: Index: openacs-dist/debian/debian/etc/init.d/dotlrn =================================================================== RCS file: /usr/local/cvsroot/openacs-dist/debian/debian/etc/init.d/dotlrn,v diff -u -r1.1 -r1.2 --- openacs-dist/debian/debian/etc/init.d/dotlrn 20 Oct 2006 20:12:08 -0000 1.1 +++ openacs-dist/debian/debian/etc/init.d/dotlrn 20 Oct 2006 22:21:58 -0000 1.2 @@ -4,8 +4,8 @@ # NAME=dotlrn -USER=www-data -GROUP=www-data +USER=dotlrn +GROUP=dotlrn ADDRESS=0.0.0.0 PORT=80 PATH=/bin:/usr/bin:/sbin:/usr/sbin