Bug 791313 - changes to mysql user are not properly handled by /etc/init.d/mysqld
Summary: changes to mysql user are not properly handled by /etc/init.d/mysqld
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mysql
Version: 5.7
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Tom Lane
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-16 17:35 UTC by jcpunk
Modified: 2013-07-03 03:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-06 03:55:26 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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