Bug 6288 - mariadb init script detects old version incorrectly
Summary: mariadb init script detects old version incorrectly
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: AL13N
QA Contact:
URL:
Whiteboard: OK
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2012-06-02 12:11 CEST by Derek Jennings
Modified: 2013-11-23 16:14 CET (History)
1 user (show)

See Also:
Source RPM: mariadb-5.5.23-4.mga2.src.rpm
CVE:
Status comment:


Attachments

Description Derek Jennings 2012-06-02 12:11:30 CEST
Description of problem:

/etc/rc.d/init.d/mysqld has a section that checks if the current version matches the previous software version. The test for OLD_VER does not work.

From line 329
    # Check if the system database should be updated and alert the user.
    NEW_VER="`$libexecdir/mysqld --version | cut -d' ' -f4 | cut -d- -f 1`"
    OLD_VER="`cat $datadir/mysql_upgrade_info | cut -d' ' -f4 | cut -d- -f 1`"

In Mageia 2 /var/lib/mysql/mysql_upgrade_info stores the version as
5.5.23-MariaDB

cat /var/lib/mysql/mysql_upgrade_info | cut -d' ' -f4 | cut -d- -f 1
returns NULL

In Mandriva  /var/lib/mysql/mysql_upgrade_info stores the version as
5.1.61

Once again cat /var/lib/mysql/mysql_upgrade_info | cut -d' ' -f4 | cut -d- -f 1 returns NULL


Version-Release number of selected component (if applicable):
mariadb-5.5.23-4.mga2.src.rpm

How reproducible:
On a new install there is no impact. On an upgrade the null result in this test has caused the init.d script to fail with a syntax error at line 338
Comment 1 Derek Jennings 2012-06-02 13:16:03 CEST
I should add this only affects mariadb when starting using init.d
systemd does not use this script.
Manuel Hiebel 2012-06-25 04:12:58 CEST

Assignee: bugsquad => alien

Comment 2 AL13N 2012-06-25 12:20:08 CEST
i don't seem to have this file, perhaps it's only used when upgrading?

i think it's likely that it's not the 4th field. (the first cut)

can you paste this file? so i can see how it looks?
AL13N 2012-07-21 12:52:39 CEST

Keywords: (none) => NEEDINFO

Comment 3 Frédéric "LpSolit" Buclin 2012-08-06 16:14:29 CEST
I have the same problem as the reporter:

# service -f mysqld
Shutting down MySQL: .... [  OK  ]
WARNING: mysql_upgrade should be run (as root). The upgrade from mysql-5.5.23 to mysql-5.5.25 may require it.
Starting MySQL: .,        [  OK  ]

So I ran mysql_upgrade as specified in the message above, and then I tried to restart MySQL again, but this no longer works:

# service -f mysqld       [ÃCHEC ]
expr: erreur de syntaxe
./mysqld: ligne 338 : [:  : nombre entier attendu comme expression
Starting MySQL: ....................................................^C

I had to use Ctrl+C to stop service, because nothing happened.

So I tried using systemctl instead, and this doesn't work either:

# systemctl stop mysqld.service
# systemctl start mysqld.service
Job failed. See system journal and 'systemctl status' for details.

# systemctl status mysqld.service
mysqld.service - MySQL database server
  Loaded: loaded (/lib/systemd/system/mysqld.service; enabled)
  Active: activating (start-post) since Mon, 06 Aug 2012 16:10:54 +0200; 45s ago
  Process: 23602 ExecStart=/usr/bin/mysqld_safe --nowatch (code=exited, status=0/SUCCESS)
  Process: 23584 ExecStartPre=/usr/sbin/mysqld-prepare-db-dir (code=exited, status=0/SUCCESS)
  Main PID: 23958 (mysqld); Control: 23959 (mysqld-wait-rea)
  CGroup: name=systemd:/system/mysqld.service
          â 23958 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --log-error=/var/l... 
          â 23959 /bin/sh /usr/sbin/mysqld-wait-ready 23958
          â 24679 sleep 1

Aug 06 16:10:54 antares mysqld_safe[23602]: 120806 16:10:54 mysqld_safe Logging to '/var/log/mysqld/mysqld.log'.
Aug 06 16:10:54 antares mysqld_safe[23602]: 120806 16:10:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

CC: (none) => LpSolit

Comment 4 Frédéric "LpSolit" Buclin 2012-08-06 17:19:40 CEST
I killed all remaining processes related to mysqld, and then I could start it normally again. No idea what went wrong.
AL13N 2012-08-21 08:04:23 CEST

Whiteboard: (none) => OK

Comment 5 Manuel Hiebel 2013-10-22 12:11:04 CEST
This message is a reminder that Mageia 2 is nearing its end of life.
Approximately one month from now Mageia will stop maintaining and issuing updates for Mageia 2. At that time this bug will be closed as WONTFIX (EOL) if it remains open with a Mageia 'version' of '2'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Mageia version prior to Mageia 2's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Mageia 2 is end of life.  If you would still like to see this bug fixed and are able to reproduce it against a later version of Mageia, you are encouraged to click on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Mageia release includes newer upstream software that fixes bugs or makes them obsolete.

-- 
The Mageia Bugsquad
Comment 6 Manuel Hiebel 2013-11-23 16:14:26 CET
Mageia 2 changed to end-of-life (EOL) status on ''22 November''. Mageia 2 is no
longer maintained, which means that it will not receive any further security or
bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of Mageia
please feel free to click on "Version" change it against that version of Mageia
and reopen this bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

--
The Mageia Bugsquad

Status: NEW => RESOLVED
Resolution: (none) => OLD


Note You need to log in before you can comment on or make changes to this bug.