Postinsts barfing when mysqld not running
bddebian at comcast.net
Mon Aug 20 23:03:09 BST 2007
Mathias Gug wrote:
> On Mon, Aug 20, 2007 at 05:24:44PM -0400, Scott Kitterman wrote:
>>> What you'd probably need to ask is the database configuration (such as
>>> host, username, password to create the tables). Try to connect to the
>>> database and fail graciously if it cannot connect.
>> Would you have an example of a package that gets it right?
> I don't. It seems that this is a pretty common operation though. Most of
> the applications need the same kind of information to setup things:
> host, username, password and database name to use. Then the postinst
> script tries to connect to the database and creates the necessary
> However, it assumes that the database and the username have already been
> created and the necessary privileges have been granted. In the case of a
> local database, the debian-sys-maintainer account could be used to
> create all of this before setting the tables for the application.
> In the case of a remote database server, the database needs to be
> created before the package is installed.
If I am reading the postinst for simba correct it does that properly.
If it can't connect with the default credentials, it prompts for them.
(I think). However, it assumes that SOME local database already exists
which obviously doesn't have to be the case.
Of course scripting is NOT my strongsuite so I could certainly be off here.
More information about the Ubuntu-motu