Bug 1063499 - mariadb fails to start due to permissions issue on /var/log/mariadb/mariadb.log
Summary: mariadb fails to start due to permissions issue on /var/log/mariadb/mariadb.log
Keywords:
Status: CLOSED DUPLICATE of bug 1061045
Alias: None
Product: Fedora
Classification: Fedora
Component: mariadb
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Honza Horak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1063466 (view as bug list)
Depends On: 1063466
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-10 21:14 UTC by Lars Kellogg-Stedman
Modified: 2014-02-11 09:47 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1063466
Environment:
Last Closed: 2014-02-11 09:47:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lars Kellogg-Stedman 2014-02-10 21:14:52 UTC
+++ This bug was initially created as a clone of Bug #1063466 +++

Description of problem:

Using openstack-packstack-2013.2.1-0.29.dev956.fc20.noarch:

When trying to install RDO on Fedora 20 via "packstack --allinone", the install fails with:

  ERROR : Error appeared during Puppet run: 172.16.0.4_mysql.pp
  Error: Could not start Service[mysqld]: Execution of '/sbin/service mariadb start' returned 1: 
  You will find full trace in log /var/tmp/packstack/20140210-191647-DfRatq/manifests/172.16.0.4_mysql.pp.log
  Please check log file /var/tmp/packstack/20140210-191647-DfRatq/openstack-setup.log for more information
  Version-Release number of selected component (if applicable):

/var/tmp/packstack/20140210-191647-DfRatq/manifests/172.16.0.4_mysql.pp.log has:

  Error: Could not start Service[mysqld]: Execution of '/sbin/service mariadb start' returned 1: 
  Error: /Stage[main]/Mysql::Server/Service[mysqld]/ensure: change from stopped to running failed: Could not start Service[mysqld]: Execution of '/sbin/service mariadb start' returned 1: 
  Error: Could not start Service[mysqld]: Execution of '/sbin/service mariadb start' returned 1: 
  Error: /Stage[main]/Mysql::Server/Service[mysqld]/ensure: change from stopped to running failed: Could not start Service[mysqld]: Execution of '/sbin/service mariadb start' returned 1: 

And the journal shows:

  # journalctl -u mariadb --full --no-pager -n10
  -- Logs begin at Mon 2014-02-10 18:51:02 UTC, end at Mon 2014-02-10 19:23:09 UTC. --
  Feb 10 19:18:17 lars-f20-0 mysqld_safe[11501]: 140210 19:18:17 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
  Feb 10 19:18:17 lars-f20-0 mysqld_safe[11501]: 140210 19:18:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
  Feb 10 19:18:17 lars-f20-0 mysqld_safe[11501]: /usr/bin/mysqld_safe: line 138: /var/log/mariadb/mariadb.log: Permission denied
  Feb 10 19:18:17 lars-f20-0 mysqld_safe[11501]: /usr/bin/mysqld_safe: line 182: /var/log/mariadb/mariadb.log: Permission denied
  Feb 10 19:18:17 lars-f20-0 mysqld_safe[11501]: 140210 19:18:17 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
  Feb 10 19:18:17 lars-f20-0 mysqld_safe[11501]: /usr/bin/mysqld_safe: line 138: /var/log/mariadb/mariadb.log: Permission denied
  Feb 10 19:18:17 lars-f20-0 systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE

This is because the log file is owned by root:

  # ls -ld /var/log/mariadb/
  drwxr-x---. 2 mysql mysql 4096 Feb 10 19:18 /var/log/mariadb/
  # ls -l /var/log/mariadb/mariadb.log 
  -rw-r--r--. 1 root root 0 Feb 10 19:18 /var/log/mariadb/mariadb.log

Fixing the permissions on that file allows mariadb to start up
correctly.

  # chown mysql:mysql /var/log/mariadb/mariadb.log
  # service mariadb start
  # service mariadb status
  Redirecting to /bin/systemctl status  mariadb.service
  mariadb.service - MariaDB database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled)
     Active: active (running) since Mon 2014-02-10 19:26:53 UTC; 41s ago

--- Additional comment from Lars Kellogg-Stedman on 2014-02-10 14:35:22 EST ---

Hmm, this may actually be an selinux issue:

# audit2allow -a
#============= mysqld_safe_t ==============
allow mysqld_safe_t var_log_t:lnk_file { read getattr };

Comment 1 Lars Kellogg-Stedman 2014-02-10 21:16:10 UTC
This turns out to be a mariadb packaging issue.  After installation, /var/log/mariadb/mariadb.log exists but is owned by root, and /var/log/mysqld.log does not exist.

Comment 2 Lars Kellogg-Stedman 2014-02-10 21:28:55 UTC
*** Bug 1063466 has been marked as a duplicate of this bug. ***

Comment 3 Honza Horak 2014-02-11 09:47:39 UTC
Thanks for reporting, the fix is on the way already, feel free to test and provide karma to mark it stable sooner:
https://admin.fedoraproject.org/updates/FEDORA-2014-2137/mariadb-5.5.35-2.fc19

*** This bug has been marked as a duplicate of bug 1061045 ***


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