mysql_install_db in rpm postinst fails with invalid user mysql

Bug #1168437 reported by jahor
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
Undecided
Unassigned
5.1
Invalid
Undecided
Unassigned
5.5
New
Critical
Alexey Bychko
5.6
Invalid
Undecided
Unassigned

Bug Description

the command "/usr/bin/mysql_install_db --rpm --user=mysql"
should be run after user mysql is created.

because post/pre script are not with "set -e" this does not cause the installation to fail. it reports the packages installed, but mysql database datafiles are not initialized (no content in /var/lib/mysql/mysql)

this could be temporary "bypass" by
  * reinstalling the package twice
  * manualy using mysql_install_db and changing ownership of datadir

current state int he package is:

if [ ! -d $mysql_datadir/test ]; then
        mkdir $mysql_datadir/test;
fi
/usr/bin/mysql_install_db --rpm --user=mysql
fi
# ----------------------------------------------------------------------
# Make MySQL start/shutdown automatically when the machine does it.
# ----------------------------------------------------------------------
...
... SNIP
...
# ----------------------------------------------------------------------
# Create a MySQL user and group. Do not report any problems if it already
# exists.
# ----------------------------------------------------------------------
groupadd -r mysql 2> /dev/null || true
useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" \
  -g mysql mysql 2> /dev/null || true
# The user may already exist, make sure it has the proper group nevertheless
# (BUG#12823)
usermod -g mysql mysql 2> /dev/null || true

Tags: pkg
Revision history for this message
jahor (jahor) wrote :

affected package is: Percona-Server-server-55-5.5.30-rel30.2.500.rhel6.x86_64

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Seems to be a regression in the bug 710799 fix, rev 463.1.1,

$ bzr log -r 463.1.1
------------------------------------------------------------
revno: 463.1.1 [merge]
fixes bug: https://launchpad.net/bugs/710799
committer: Alexey Bychko <email address hidden>
branch nick: bug710799-5.5
timestamp: Thu 2013-03-07 19:45:40 +0700
message:
  fix for bug 710799, version 5.5
  [-] disabled uncongitional manual creation of /var/lib/mysql/*
  [+] added conditional call of mysql_install_db, only for clean installation, but not for upgrade
  [+] added debug possibility for %post
------------------------------------------------------------

tags: added: pkg
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

5.6 is OK since bug 710799 fix was not merged there.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@#3,

5.6 PS doesn't have the fix of lp:710799 and lp: 1170024 (the latter is required to fix the first one which was a fix for update issue).

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.