[pkg-bacula-devel] Bug#679855: bacula-director-mysql: update_mysql_tables does not use dbname when applying SQL update commands

Alexander Golovko alexandro at ankalagon.ru
Tue Jul 3 07:24:52 UTC 2012


On Mon, 02 Jul 2012 23:30:48 +0200, Dominik Sommer wrote:
> Hi Alexander,
>
> thanks for the quick response!
>
> Regarding 1., I attached the relevant parts of apt/term.log. I have 
> not
> been asked anything bacula-related during the update (there were 
> prompts
> for other packages though). Aptitude also updated MySQL from 5.1 to 
> 5.5
> in the same update batch. I have to admit I don't know if my system 
> is
> using dbconfig-common. I assume it does, because running 'locate
> dbconfig-common' yields some results.

Your log look like dbconfig-common was disabled.

Does /etc/dbconfig-common/bacula-director-mysql.conf contain next line?
dbc_upgrade='false'

and what output of "debconf-show bacula-director-mysql"?

If i don't wrong, than database upgrade with dbconfig-common was 
disabled and it is normal, that database need to be updated manually.


>
> Regarding 2., yes I used 
> /usr/share/bacula-director/update_mysql_tables
> for the DB update. The primary reason for the bug report was the 
> error
> in line 24 of that script - here's how it looked like:
>
> if mysql $* -f <<END-OF-DATA
> CREATE TABLE RestoreObject (
>
> And this is how it should be:
>
> if mysql $* -D ${db_name} -f <<END-OF-DATA
> CREATE TABLE RestoreObject (
>
> My bacula works again, so I'm fine now. Just wanted to contribute 
> this
> bugfix ;-)

Ok, i understand you, this is because we concentrate on automatic 
database manage with dbconfig-common.

Will be enough to run script in next maneer?
/usr/share/bacula-director/update_mysql_tables -D <database>

>
> - Dominik
>
>
> On 02.07.2012 13:15, Alexander Golovko wrote:
>> Hi!
>>
>> Thank you for report!
>>
>>
>> 1. Package upgrade
>>
>> Bacula packages use dbconfig-common for install and upgrade 
>> database.
>>
>> It didn't run for some reason. Can you give the next information 
>> about
>> your system?
>>
>> Are you use dbconfig-common for install database (when installing
>> previous version of package)?
>> Are you see prompt for upgrade database with dbconfig-common?
>> If you see prompt, what are you choose?
>> Was any errors on upgrade?
>>
>> If you use "apt-get [dist-]upgrade", please post 
>> /var/log/apt/term.log
>> and /var/log/apt/history.log
>> In other case, may be you have saved console output of package 
>> updating
>> process?
>>
>>
>> 2. Manual database updating
>>
>> Are you use /usr/share/bacula-director/update_mysql_tables for 
>> update
>> database?
>> This script don't work out-of-box, due we remove database selection 
>> from
>> it (for simplify dbconfig-common usage). But if you apply SQL code 
>> from
>> it, there was enough for correct bacula-director work.
>>
>>
>> On Mon, 02 Jul 2012 08:12:55 +0200, Dominik Sommer wrote:
>>> Package: bacula-director-mysql
>>> Version: 5.2.6+dfsg-1
>>> Severity: important
>>>
>>> Dear Maintainer,
>>>
>>>    * What led up to the situation?
>>>
>>> I just updated to the most recent debian testing package, and
>>> bacula-director didn't start any longer.
>>> Running it manually (without the init.d script) showed the DB had 
>>> not
>>> been updated (a notice during
>>> aptitude's update process would have been helpful btw). Googling 
>>> for
>>> a solution, I found there's an
>>> update script - update_mysql_tables. Running it untouched, it asked
>>> me to set the DB name to update
>>> in the script, which I did. Re-running yielded a couple of "no
>>> database selected" errors.
>>>
>>>    * What exactly did you do (or not do) that was effective (or
>>>      ineffective)?
>>>
>>> Looking into the script, it seems like the db_name parameter is 
>>> only
>>> used for querying the version
>>> information, but not for actually applying the SQL. So I just added
>>> the missing
>>> -D ${db_name}
>>> from the first mysql command (line 13) to the second one (line 24).
>>>
>>>    * What was the outcome of this action?
>>>
>>> The update was now applied successfully and bacula-dir started 
>>> again.
>>>
>>>
>>> -- System Information:
>>> Debian Release: wheezy/sid
>>>   APT prefers testing
>>>   APT policy: (990, 'testing'), (500, 'unstable'), (500,
>>> 'oldstable'), (400, 'stable')
>>> Architecture: i386 (i686)
>>>
>>> Kernel: Linux 3.2.0-2-486
>>> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
>>> Shell: /bin/sh linked to /bin/dash
>>>
>>> Versions of packages bacula-director-mysql depends on:
>>> ii  bacula-common                    5.2.6+dfsg-1
>>> ii  bacula-common-mysql              5.2.6+dfsg-1
>>> ii  bacula-director-common           5.2.6+dfsg-1
>>> ii  dbconfig-common                  1.8.47+nmu1
>>> ii  debconf [debconf-2.0]            1.5.44
>>> ii  libc6                            2.13-33
>>> ii  libgcc1                          1:4.7.0-8
>>> ii  libpython2.7                     2.7.3~rc2-2.1
>>> ii  libssl1.0.0                      1.0.1c-3
>>> ii  libstdc++6                       4.7.0-8
>>> ii  libwrap0                         7.6.q-23
>>> ii  mysql-client-5.5 [mysql-client]  5.5.24+dfsg-4
>>> ii  ucf                              3.0025+nmu3
>>> ii  zlib1g                           1:1.2.7.dfsg-13
>>>
>>> Versions of packages bacula-director-mysql recommends:
>>> ii  mysql-server  5.5.24+dfsg-4
>>>
>>> Versions of packages bacula-director-mysql suggests:
>>> ii  gawk  1:4.0.1+dfsg-2
>>>
>>> -- no debconf information
>>>
>>>
>>>
>>> _______________________________________________
>>> pkg-bacula-devel mailing list
>>> pkg-bacula-devel at lists.alioth.debian.org
>>>
>>> 
>>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-bacula-devel
>>

-- 
with best regards,
Alexander Golovko
email: alexandro at ankalagon.ru
xmpp: alexandro at ankalagon.ru



More information about the pkg-bacula-devel mailing list