Bug 791313

Summary: changes to mysql user are not properly handled by /etc/init.d/mysqld
Product: Red Hat Enterprise Linux 5 Reporter: jcpunk
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED DEFERRED QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.7CC: byte, hhorak
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-06 03:55:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description jcpunk 2012-02-16 17:35:38 UTC
Description of problem: at my site there is one system where the mysql user is not the user we run mysql as (historical reasons, can't change).  Thus every time there is an update for mysql I am required to modify the init.d script.  This is a bit odd as in /etc/my.cnf there is a 'user' entry for mysqld.

It would be nice if /etc/init.d/mysqld used the value for user I've set in /etc/my.cnf


Version-Release number of selected component (if applicable):mysql-5.0.95-1.el5_7.1


How reproducible: always


Steps to Reproduce:
1. stop mysql
2. set [mysqld] user=dbuser
3. start mysql
4. check to see what user it is running as
  
Actual results: runs as mysql


Expected results: run as dbuser


Additional info:
There appears to be a script for determining the location of the datadir and whatnot already in use within the init script.

Comment 1 Tom Lane 2012-02-16 17:47:37 UTC
There's basically no chance that we're going to support that within the Red Hat packaging, as for example there are files in the RPMs that are owned by the RPM-created mysql user.  The initscript is merely the smallest and easiest to fix tip of that iceberg.  In versions later than RHEL5 there is also SELinux security policy to contend with.  I'd recommend migrating away from your nonstandard user selection, instead.

Comment 2 Tom Lane 2013-03-06 03:55:26 UTC
This isn't going to get fixed in RHEL5, although I think systemd-based packaging might be more flexible.