Bug #10984 install fails if group mysql exists but not user
Submitted: 31 May 2005 14:11 Modified: 19 Jul 2005 12:37
Reporter: Jeff Templon Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:4.0.20-0 OS:Linux (CentOS 3.4)
Assigned to: Lenz Grimmer CPU Architecture:Any

[31 May 2005 14:11] Jeff Templon
Description:
I tried to install the mysql server RPM on a machine for which the
group 'mysql' already existed, but not the user 'mysql'.

The server RPM install failed due to the use of a 'useradd' command
in the RPM's post-install script.  The error returned was:

    'group mysql already exists ... if you want to add the user to this group, use -g'

If the group already exists, I think mysql should just use it rather than failing.

How to repeat:
create group 'mysql'
make sure there is no user 'mysql'
install the server RPM.

Suggested fix:
test for existence of mysql group / user.  depending on what is found, run the appropriate useradd command.
[6 Jul 2005 4:53] Jorge del Conde
I was able to reproduce this bug using 4.1.12 and Fedora Core 4.  I manually deleted the mysql user from /etc/passwd, and kept the entry in /etc/group
[14 Jul 2005 20:14] Lenz Grimmer
This seems to be specific to Linux distributions (e.g. Red Hat) that create a separate group for every user created. I was not able to reproduce this on a SUSE system.
I think I will add a line to create the group "mysql" if it does not yet exist first and will then explicitely assign the "mysql" user to the "mysql" user group.

Another option would be to use the "daemon" user group (which should exist by default), but the LSB generally discourages using this group for all daemons - see http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/usernames.ht...
[15 Jul 2005 7:07] 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/27131
[19 Jul 2005 12:37] Lenz Grimmer
Now fixed for 4.0.26, 4.1.13 and 5.0.10.