Bug 1149986

Summary: mysqld fails to start due to improper file ownership of /var/log/mysqld.log
Product: [Fedora] Fedora Reporter: Rodd Clarkson <rodd>
Component: community-mysqlAssignee: Honza Horak <hhorak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: hhorak, jstanek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: community-mysql-5.6.21-5.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-21 01:25:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rodd Clarkson 2014-10-07 06:34:03 UTC
Description of problem:

On a fresh install of fedora 21 alpha, I have installed community-mysql-server and then tried to start it with systemctl start mysqld.

It fails to start.  The journalctl output shows:

-- Unit mysqld.service has failed.
-- 
-- The result is failed.
Oct 07 17:17:40 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
Oct 07 17:19:16 localhost.localdomain mysql-prepare-db-dir[32586]: touch: cannot touch '/var/log/mysqld.log': Permission denied
Oct 07 17:19:16 localhost.localdomain mysql-prepare-db-dir[32586]: The log file /var/log/mysqld.log cannot be touched, please, fix its permissions.
Oct 07 17:19:16 localhost.localdomain mysql-prepare-db-dir[32586]: The daemon will be run under mysql:mysql
Oct 07 17:19:16 localhost.localdomain systemd[1]: mysqld.service: control process exited, code=exited status=1
Oct 07 17:19:16 localhost.localdomain systemd[1]: Failed to start MySQL 5.6 database server.



In /var/log

# ls -l mysqld.log 
-rw-r--r--. 1 root root 0 Oct  7 17:13 mysqld.log


The ownership of this file is wrong and should be mysql.mysql and running chown mysql.mysql fixes it.


Version-Release number of selected component (if applicable):

community-mysql-server-5.6.20-3.fc21.x86_64


How reproducible:

On fresh install.


Steps to Reproduce:
1. Install community-mysql-server
2. Start with systemctl start mysqld


Actual results:

Fails as above


Expected results:

Should start without issue.



Additional info:

I think https://bugzilla.redhat.com/show_bug.cgi?id=1061045 is very closely related but as closed and related to mariadb so I've filed a new bug.

Comment 1 Fedora Update System 2014-10-13 20:40:06 UTC
community-mysql-5.6.21-5.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/community-mysql-5.6.21-5.fc21

Comment 2 Fedora Update System 2014-10-16 02:05:31 UTC
Package community-mysql-5.6.21-5.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing community-mysql-5.6.21-5.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-12883/community-mysql-5.6.21-5.fc21
then log in and leave karma (feedback).

Comment 3 Rodd Clarkson 2014-10-20 11:16:44 UTC
I've seen the update come through but I've had to manually handle the ownership issue as I need to use this system for web development.

I've access to another fedora 21 box at work and will install and test there.

Are you able to suggest how I can test this on my system without having to reinstall?

Comment 4 Honza Horak 2014-10-20 11:36:44 UTC
(In reply to Rodd Clarkson from comment #3)
> Are you able to suggest how I can test this on my system without having to
> reinstall?

I guess something like this might serve for testing, i.e. has the same effect as the patch applied:
#> cat <<EOF >/etc/systemd/system/mysqld.service.d/perm.conf
[Service]
PermissionsStartOnly=true
EOF
#> systemctl daemon-reload
#> systemctl restart mysqld

Comment 5 Rodd Clarkson 2014-10-21 01:25:57 UTC
Did a check on a fresh install and this is resolved.

Thanks

Comment 6 Fedora Update System 2014-11-01 17:09:11 UTC
community-mysql-5.6.21-5.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.