[Dbconfig-common-devel] Re: dbconfig-common - short question

sean finney seanius at debian.org
Wed Feb 8 22:08:41 UTC 2006


hey marcin,

(re-adding dbconfig-common-devel at lists.alioth.debian.org to the cc)

On Wed, Feb 08, 2006 at 12:38:10PM +0100, Marcin Antczak wrote:
> mywebapp-mysql-local
> mywebapp-mysql-remote
> mywebapp-core
> 
> First two have mywebapp-core as dependency.

it's not the most graceful of solutions, but it's at least effective.
i've heard some other people propose a simlar solution and even if
it isn't graceful, it's clean to implement and would reliably work.

> So, in mywebapp-mysql-local I got mysql-server as dependency so it should
> get installed automagically with apt-get.
> Then I would like to use default debian-sys-maint credentials to log in as
> mysql admin and drop database for my webapp and create user for webapp.

drop the database?  you mean create?

> Anyway currently the problem is that for unexperienced user things are more
> confusing than we expect.
> 
> Because currently user can install some webapp - then he goes to browser and
> gets error messages related to lack of mysql-server.

no, what should happen is when they install the package, they get an
error message saying "can not connect to mysql server, what would
you like to do?"

> Then he is smart enough to install mysql-server and maybe even to
> dpkg-reconfigure his webapp package.
> But still no luck.
> 
> Because he doesn't have to know that first he needs to use 'mysqladmin -u
> root password pass' to get root password to mysql which is required by
> dbconfig-common.

nope... the current default on debian systems is to install mysql-server
with a passwordless root account.  so... if we're dealing with osmeone
who doesn't know what's going on then they'll just hit enter when
prompted for the admin password, and things will still work.

> I agree but first it needs mysql-server admin credentials to connect to
> database server. Right?
> 
> No admin password = no database drop.

dbc will prompt for the admin password, and will let them know if
it doesn't work.

> But it means that I _need_ it - by default after 'apt-get install
> mysql-server' I got mysql-server up and running but I don't have a clue what
> is admin account and what is sysadmin password.

> Currently I would like to add only one thing.
> I would like to have an ability to provide dbc_dbadmpass from file not only
> from debconf input.

i think such a behaviour is probably better a "global" option, that is
the answer "yes use debian.cnf" for installing one package will probably
be the same for any othermysql package installed.  so then what would
probably be simplest is to put in dbc's config script something like:

if -f debian.cnf
	prompt if i should use it

and then write the result into /etc/dbconfig-common/config
during postinst.  then the dbc helper scripts that run for individual
packages could check the setting from this file and if it's set to true
run mysql commands
with --defaults-extra-file=debian.cnf.

> > you should get a question about the root user's password too, shouldn't
> > you?
> 
> 
> NO! :)
> I don't need it I want dbconfig-common to be smart enough to get admin
> password from /etc/mysql/debian.cnf

okay, there was a mistranslation somewhere here: by "you should get a
question", i meant "wasn't there a question".

> I'll try to take a look at cacti later and I'll send info to you.

apt-cache policy cacti will tell you what version it is that you're
installing.

if you really want to see how a dbc app is supposed work, i recommend
the following:

apt-get install dbconfig-common
cp -r /usr/share/doc/dbconfig-common/examples/db-example-2.0 .
cd db-example-2.0
dpkg-buildpackage -rfakeroot
dpkg -i ../db-test-mysql_2.0_all.deb (or whatever the resulting deb is called)


	sean

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/dbconfig-common-devel/attachments/20060208/ca4ed3f0/attachment.pgp


More information about the Dbconfig-common-devel mailing list