moodle into main for gutsy

Matt Oquist moquist at majen.net
Wed Aug 29 07:34:15 BST 2007


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: http://revu.tauware.de/details.py?upid=133

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 ubuntu.com>
> To: Matt Oquist <moquist at majen.net>
> Cc: Oliver Grawert <ogra at ubuntu.com>
> 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
http://majen.net/



More information about the Ubuntu-motu mailing list