moodle into main for gutsy

Matt Oquist moquist at
Thu Aug 30 04:57:31 BST 2007

REVU is down ATM, so I've uploaded my latest moodle package here:

My test system came back up, which I did not expect. I'm using it much
more gingerly now, and so far, so good.

I've successfully installed Moodle with mysql *and* with postgresql
using this package (though it's been quite a while since I tested

FWIW, this package fixes a bug from upstream. Upstream creates the
postgresql database without UTF8 encoding, so Moodle 1.8.2 refuses to

AFAICT we have three remaining issues of importance:
1. two wwwconfig references in preinst:
   This only executes if the package is being upgraded, so I've been
   safe ignoring it in my preliminary testing of new installs.

   This mucks about in webserver .conf files and removes Include
   statements from older installations of this moodle package.

   I think that if we hit this condition we should tell the user to fix
   the configuration manually and run 'dpkg-reconfigure moodle'.

2. dpkg asks for the database host, database administrator, and
   database administrator password, and these are never used for
   postgresql configuration. In fact, as I said below, I think we
   should just give up on creating a postgresql database if the
   database host is NOT "localhost". Since this is a regression from
   what the upstream package has been supporting I'm asking here first
   instead of implementing this immediately.

3. this package doesn't install correctly unless you've already
   installed your database server/client packages. i.e., you must do
   one of these before 'apt-get install moodle':
   $ apt-get install postgresql postgresql-client
   $ apt-get install mysql-server mysql-client


Matt Oquist wrote:    [Wed Aug 29 2007, 02:34:15AM EDT]
> Hello MsOTU,
> I've been paddling around in the packaging deep end, trying to get rid
> of wwwconfig deps in the Moodle package so we can get it into main and
> ship it on the Gutsy Edubuntu CD.
> My latest effort is in REVU:
> As I mentioned in a comment there, my testing server just died
> (again!), and that has killed any chances of me testing this further
> until at least tomorrow. I will appreciate any and all testing help!
> There are two remaining references to wwwconfig in the preinst script
> and I haven't figured out how to deal with those yet. They're just
> un-including the moodle apache configuration file, so there should be
> a simple way to deal with that without using wwwconfig.
> As I mentioned in the comment attached to my 29 Aug. upload, the
> wwwconfig-less postgresql support I've just added is a *regression*
> because the package used to support the creation of a postgresql
> database on a remote server. However, after receiving the following
> email from Martin Pitt, I no longer believe that should even be
> supported because of the potential problems:
> --------------------------------------------------------
> > From: Martin Pitt <martin.pitt at>
> > To: Matt Oquist <moquist at>
> > Cc: Oliver Grawert <ogra at>
> > Subject: Re: PostgreSQL in moodle postinst
> >
> > Hi Matt,
> >
> > Matt Oquist [2007-08-13  0:26 -0400]:
> > > Do you know any packages OTOYH that create a postgres user and set up
> > > a postgres database in postinst, without using wwwconfig?
> >
> > Not of the top of my head. I saw some which just had some instructions
> > how to set it up manually. I see good reasons for doing it that way,
> > too; as soon as the postgresql configuration gets customized in any
> > way (authentication map, multiple clusters, different PostgreSQL
> > versions, DB on remote server, etc.), you must not touch the
> > configuration, otherwise you'll break existing setups.
> >
> > > I expect I just su to postgres and createuser, etc., but I'm
> > > definitely not solid on that and would appreciate a pointer toward an
> > > example, or even just advice in general.
> >
> > Creating a system and psql user with adduser and createuser, and the
> > database with createdb is not the problem, right. The tricky bit is
> > when to do it, or rather, when *not*. Writing a program that helps
> > with this job is a long-standing TODO entry for postgresql-common, but
> > I didn't get around to it yet because it is really hairy to do it
> > correctly.
> >
> > As a first approximation, I think you can assume to have a default
> > configuration (and thus can do the automatic setup) iff:
> >
> >  * "pg_lsclusters -h" has exactly one line of output and succeeds.
> >    Parse out the first two fields as $VERSION and $CLUSTER.
> >
> >  * grep -q '^local.*all.*all.*ident.*sameuser$' /etc/postgresql/$VERSION/$CLUSTER/pg_hba.conf
> >    succeeds.
> >
> >  * "su -c 'psql -Atl' postgres" does not yet have the target database
> >    you want to configure.
> >
> > Martin
> --------------------------------------------------------
> This means that some of the questions asked during installation are
> irrelevant to postgresql and mistakenly imply support for an
> automatically-created remote posgresql database. Perhaps postinst
> script should simply check for 'localhost' in the database host
> answer, and print a message if any other value is submitted: "Sorry,
> only local postgresql databases can be automatically created.  You'll
> have to create your database yourself."
> I'll get back to work on this as soon as I have a test system
> available, but if somebody else takes this and finishes it I won't be
> offended in the least, especially since we're already past the
> deadline. I don't want to be holding up something this important.
> Regards,
> Matt
> --
> Open Source Software Engineering Consultant
Open Source Software Engineering Consultant

718 Fox Hollow Drive
Hudson, NH  03051  U.S.A.
+1 603.236.1054 (cell)

More information about the Ubuntu-motu mailing list