Bug #12348 Installation RPM fails because of groupadd on CentOS Linux.
Submitted: 3 Aug 2005 14:46 Modified: 8 Aug 2005 16:20
Reporter: Greg Johnson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:4.1.13 OS:Linux (CentOS 4.1)
Assigned to: Lenz Grimmer CPU Architecture:Any

[3 Aug 2005 14:46] Greg Johnson
Description:
I attempted an RPM installation of mysql server on CentOS Linux.

rpm -vih MySQL-server-4.1.13-0.i386.rpm

The installation failed, because the group 'mysql' is not created. I searched through the rpm, and found the following line:

groupadd -r -c "MySQL server" mysql 2> /dev/null || true

On CentOS Linux, the "-c" argument is not valid for groupadd:
usage: groupadd [-g gid [-o]] [-r] [-f] group

How to repeat:
rpm -vih MySQL-server-4.1.13-0.i386.rpm

Suggested fix:
Remove: -c "MySQL server" from the install script.

(I was able to install 4.1.10a via yum, as a work-around.)
[3 Aug 2005 14:47] Greg Johnson
Changed to "Installing"....that category wasn't available when I submitted the bug...only when I edit the submission. :-/
[3 Aug 2005 16:09] Aleksey Kishkin
duplicate of http://bugs.mysql.com/bug.php?id=10984
[3 Aug 2005 16:12] Aleksey Kishkin
Sorry it isn't duplicate but just similar bugs
[3 Aug 2005 16:38] Aleksey Kishkin
Greg, I tested on suse ('cause I don't have installed centos yet) and if no mysql group, rpm warns about wrong argument for groupadd and about wrong grouop in the chown command. Despite this fact mysql server was installed and worked. (with mysql:root ownership for datadir).

option -c for groupadd of course is wrong. But what did you mean "Installation RPM fails"? Server was not installed on Centos?
[3 Aug 2005 17:20] Greg Johnson
Aleksey,
Because the mysql group was never created, the adduser command also failed. Following that, the chown mysql:mysql failed.
Then, since the mysql user didn't exist, the startup commands (to init the database, etc.) failed because of permission errors. I believe the rest of the files got "installed", but they won't run because of permission/group problems.
I don't think there is anything else that is a complication....just the "-c" argument on the groupadd command that shouldn't be there. If the groupadd had worked correctly, the rest of the install would probably have completed correctly.
[4 Aug 2005 10:16] Lenz Grimmer
I confirm that the "-c" option to groupadd is the culprit. I will fix this in the RPM spec file for future releases. As a workaround, the "mysql" user group should be created manually before installing the MySQL-server RPM by using this command:

  groupadd -r mysql
[4 Aug 2005 10:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27884
[4 Aug 2005 12:45] Lenz Grimmer
Fix was pushed into 4.0-5.0.
[8 Aug 2005 10:06] Lenz Grimmer
To be more precise (for documentation purposes): Fixed for 4.0.26, 4.1.14 and 5.0.11.
[8 Aug 2005 16:20] Mike Hillyer
Added to changelogs:

<listitem><para>Addition of <literal>mysql</literal> group failed on CentOS install. (Bug #12348)</para></listitem>