bacula-director-mysql installed and started before mysql-server

Bug #293515 reported by Dulmandakh Sukhbaatar on 2008-11-04
46
This bug affects 6 people
Affects Status Importance Assigned to Milestone
bacula (Ubuntu)
Medium
Unassigned

Bug Description

when installing bacula on fresh system, it will try to install mysql-server as a default catalog server. but running the process it installs and sets up bacula-director-mysql before mysql-server package. which means it'll fail to configure and create catalog database, and will get unusable bacula system.

and after having this problem, I run sudo dpkg-reconfigure bacula-director-mysql, after which says
Config error: Cannot open config file "/etc/bacula/bacula-dir.conf": No such file or directory

it's Ubuntu Intrepid.

Related branches

CVE References

Ante Karamatić (ivoks) wrote :

bacula-director-mysql doesn't depend on mysql server, cause it can connect to some other already running mysql server. But, reconfigure should be smart enough to (re)create database and do all the magic once mysql-server is configured.

Changed in bacula:
importance: Undecided → Medium
status: New → Triaged

of course. when doing 'sudo dpkg-reconfigure bacula-director-mysql' it asks everything as usual. but it cannot start bacula-dir because of above problem or /etc/bacula/bacula-dir.conf doesn't exist.

Chip Williams (chipw) wrote :
Download full text (3.2 KiB)

After the crash that caused me to create duplicate bug #297012 I did another complete OS install, installed mysql, then bacula and things seemed to work. I logged an additional bug because when the install failed for me it locked up the whole OS. This was not something I had seen reported before.

I had started my efforts with bacula under Hardy, had the same problem and just decided to wait for Intrepid to see if it would make a difference.

I also have a Hardy server amd64 install which is where this will all end up some day. It acted different, which I attributed to the LAMP install having gone ahead and putting mysql in for other reasons. It installed correctly the first time but when I messed with it and broke it I could never get back to a point where I could install again and created the same problem here. In the end I had to do two things to get the install to work:
1) Delete enough files and mess up the package bad enough that bacula would get completely downloaded and run again from scratch.
2) Get rid of the bacula database from mysql. I'm guessing the bacula install doesn't like there to already be a database by that name.

My steps went something like shown below. If somebody really knows how to get the system back to a pre-bacula-install state without all this mess it would be good to know.
o sudo apt-get update
o sudo apt-get purge bacula {this will not succeed if it is screwed up. If it does succeed you are done}
o sudo apt-get autoremove {clean up some stuff}
o cd /var/lib/dpkg/info
o sudo rm bacula-director-mysql.prerm {get rid of the most likely offending script file}
o sudo apt-get purge bacula {may appear to succeed but likely leaves stuff}
o sudo apt-get autoremove {clean up some stuff}
o cd /etc/init.d
o sudo ./bacula-director stop {stop the director if it’s running}
o sudo ./bacula-sd stop {stop the storage daemon if it’s running}
o sudo ./bacula-fd stop {stop the file daemon if it’s running}
o sudo rm bacula* {gets rid of the daemons altogether}
o cd /etc
o sudo rm bacula –r {gets rid of the .conf and script files}
o cd /var/lib
o sudo rm bacula –r {gets rid of run states and logs}
o cd /var/run
o sudo rm bacula –r {gets rid of .pid files}
o cd /var/lib/dpkg/info
o sudo rm bacula* {gets rid of all the bacula related package script files. This is likely to make the package managers very unhappy}
o You should then go into synaptic. Find anything that still says it’s installed, mark it for complete removal and remove it. This will force the next attempt to download it all again (make sure you do a Synaptic refresh or apt-get update).
o You then get rid of the bacula database from mysql:
- mysqladmin –u root –p ping
- Provide the password when asked.
- This will respond with whether the mysql server is running or not.
- mysqladmin –u root –p drop bacula
- Provide the password when asked.
- This will drop the bacula database altogether.
- If the command mysqladmin is not found then likely mysql is not installed.

I then checked that the mysql server was still running:
mysqladmin -u root -p ping
Then did a bacula install:
sudo apt-get update
sudo apt-get install bacula

It's ugly but it finally got me there on the Hardy mac...

Read more...

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bacula - 2.4.4-1ubuntu1

---------------
bacula (2.4.4-1ubuntu1) jaunty; urgency=low

  * Upload fixes LP #269251, LP: #308903 and LP: #293515
  * debian/rules:
    - added bat_icon.png and bat.desktop for bacula-console-qt (LP: #314746)
    - added bacula-tray-monitor.xpm icon, fix Exec path in .desktop
  * debian/bacula-traymonitor.install
    - remove bacula-tray-monitor.xpm, add bacula-tray-monitor.desktop
  * Merge from debian unstable, remaining changes:
    * Store sd|fd|director passwords in debconf (LP: #222558)
      - added debian/bacula-common.templates
      - modified debian/bacula-common.postinst:
        + generate random passwords and store them in debconf
      - modified debian/bacula-[sd|fd|director-mysql|director-pgsql].postinst
        + read and set passwords from debconf
    * Daemons listen on all interfaces (LP: #286643)
    * Start daemons on installation
    * Build with generic XXX_*_XXX username, password and database name
      and replace it with dbconfig's settings in postinstall scripts
    * Drop mt-st to suggests. So that bacula goes back to main. (LP: #286528)
    * debian/rules: Disable fortify source since it was causing
      bacula-director to segfault.
    * debian/control:
      - Added libdbi-perl and libdb-mysql-perl to depends for
        bacula-director-mysql
        due to new postinst configuration.
      - Cleaned up bacula-director-pgsql dependenices and recommends.
      - Made mysql the default director to install bacula-director-{mysql|pgsql}
        added database handling to postinstall scripts and templates, modifiied
        postinstall script's sed expressions.
      - Removed libwgtk-2.6-dev as a build dependency; as a result
        bacula-console-wx isn't built anymore.
      - Install gawk if not installed. (LP: #207527)
    * debian/make_catalog_backup_awk.[mysql|pgsql|sqlite3|sqlite]:
      - New scripts for catalog backup. (CVE-2007-5626)
    * debian/bacula-console-wx:
      - Dropped since we are not building them anymore.
    * debian/bacula-director-common.bacula-director.init,
      debian/bacula-fd.init, debian/bacula-sd.init
      - Made more LSB specific.

 -- Ante Karamatic <email address hidden> Sat, 10 Jan 2009 04:57:41 +0000

Changed in bacula:
status: Triaged → Fix Released
Thomas Schweikle (tps) wrote :

This bug isn't fixed at all: same with precise!

Additional:
- taking the bacula documentation: "create-bacula-mysql-db" script is missing from install.
- taking the bacula documentation: "create-bacula-pgsql-db" script is missing from install.

Bad boys bad! I've mentioned this with intrepid, now, with precise same errors arrises again. How often do I have to tell you to put those scripts into the install, not into some hidden routine called by the installer only in case of a new install not an upgrade???

This is the case for compleately killed bacula databases while upgrading from bacula as found on Lucid to Precise.

NOW: PUT THESE DATABASE CREATION SCRIPTS WHERE THEY BELONG TO! I am seaching for them where bacula documentation state they are: /etc/bacula/scripts! Not at some documentation folder deeply burried into the system and not installed if you do not install docs.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers