1

I followed these instructions in installing mariadb on my fedora 27 VM. My mariadb.repo is configured as follows:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2.12/fedora26-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

On startup I get the following error message: Job for mariadb.service failed because a fatal signal was delivered to the control process. so I dug deeper and first grabbed the output of journalctl:

    Jan 25 16:34:13 systemd[1]: Starting MariaDB 10.2.12 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has begun starting up.
Jan 25 16:34:13 audit: SELINUX_ERR op=security_bounded_transition seresult=denied oldcontext=system_u:system_r:init_t:s0 newcontext=system_u:system_r:mysqld_t:s0
Jan 25 16:34:13 audit[8032]: AVC avc:  denied  { map } for  pid=8032 comm="mysqld" path="/usr/sbin/mysqld" dev="vda1" ino=142762 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:mysqld_exec_t:s0 tclass=file permissive=0
Jan 25 16:34:13 audit[8032]: ANOM_ABEND auid=4294967295 uid=993 gid=990 ses=4294967295 subj=system_u:system_r:init_t:s0 pid=8032 comm="mysqld" exe="/usr/sbin/mysqld" sig=11 res=1
Jan 25 16:34:13 systemd[1]: mariadb.service: Main process exited, code=killed, status=11/SEGV
Jan 25 16:34:13 systemd[1]: Failed to start MariaDB 10.2.12 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
Jan 25 16:34:13 systemd[1]: mariadb.service: Unit entered failed state.
Jan 25 16:34:13 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mariadb comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Jan 25 16:34:13 systemd[1]: mariadb.service: Failed with result 'signal'.
Jan 25 16:34:14 audit[7843]: USER_END pid=7843 uid=0 auid=1018 ses=48 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=
Jan 25 16:34:14 sudo[7843]: pam_unix(sudo:session): session closed for user root
Jan 25 16:34:14 audit[7843]: CRED_DISP pid=7843 uid=0 auid=1018 ses=48 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
Jan 25 16:34:18 systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.
Jan 25 16:34:18 systemd[1]: Stopped MariaDB 10.2.12 database server.
-- Subject: Unit mariadb.service has finished shutting down
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has finished shutting down.
Jan 25 16:34:18 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mariadb comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jan 25 16:34:18 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mariadb comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jan 25 16:34:18 systemd[1]: Starting MariaDB 10.2.12 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has begun starting up.
Jan 25 16:34:18 audit: SELINUX_ERR op=security_bounded_transition seresult=denied oldcontext=system_u:system_r:init_t:s0 newcontext=system_u:system_r:mysqld_t:s0
Jan 25 16:34:18 audit[8045]: AVC avc:  denied  { map } for  pid=8045 comm="mysqld" path="/usr/sbin/mysqld" dev="vda1" ino=142762 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:mysqld_exec_t:s0 tclass=file permissive=0
Jan 25 16:34:18 audit[8045]: ANOM_ABEND auid=4294967295 uid=993 gid=990 ses=4294967295 subj=system_u:system_r:init_t:s0 pid=8045 comm="mysqld" exe="/usr/sbin/mysqld" sig=11 res=1
Jan 25 16:34:18 systemd[1]: mariadb.service: Main process exited, code=killed, status=11/SEGV
Jan 25 16:34:18 systemd[1]: Failed to start MariaDB 10.2.12 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
Jan 25 16:34:18 systemd[1]: mariadb.service: Unit entered failed state.
Jan 25 16:34:18 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mariadb comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Jan 25 16:34:18 systemd[1]: mariadb.service: Failed with result 'signal'.
Jan 25 16:34:22 sudo[8047]:    DarkStar1 : TTY=pts/1 ; PWD=/home/DarkStar1 ; USER=root ; COMMAND=/usr/bin/journalctl -xe --no-hostname
Jan 25 16:34:22 audit[8047]: USER_CMD pid=8047 uid=1018 auid=1018 ses=48 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='cwd="/home/DarkStar1" cmd=6A6F75726E616C63746C202D7865202D2D6E6F2D686F73746E616D65 terminal=pts/1 res=success'
Jan 25 16:34:22 audit[8047]: CRED_REFR pid=8047 uid=0 auid=1018 ses=48 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_fprintd acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
Jan 25 16:34:22 sudo[8047]: pam_systemd(sudo:session): Cannot create session: Already running in a session
Jan 25 16:34:22 sudo[8047]: pam_unix(sudo:session): session opened for user root by DarkStar1(uid=0)
Jan 25 16:34:22 audit[8047]: USER_START pid=8047 uid=0 auid=1018 ses=48 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname

I tried searching for the SELinux error but came up short however the best inkling at what maybe wrong comes from the output of sealert but I haven't been able to, so far, successfully execute the suggestions for possibly remedying the issue (ausearch -c 'mysqld' --raw | audit2allow -M my-mysqld):

101% done
found 1 alerts in /var/log/audit/audit.log
--------------------------------------------------------------------------------

SELinux is preventing mysqld from map access on the file /usr/sbin/mysqld.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that mysqld should be allowed map access on the mysqld file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'mysqld' --raw | audit2allow -M my-mysqld
# semodule -X 300 -i my-mysqld.pp


Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:object_r:mysqld_exec_t:s0
Target Objects                /usr/sbin/mysqld [ file ]
Source                        mysqld
Source Path                   mysqld
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages
Target RPM Packages           MariaDB-server-10.2.12-1.fc26.x86_64
Policy RPM                    selinux-policy-3.13.1-283.21.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     my.domain.com
Platform                      Linux my.domain.com
                              4.13.9-300.fc27.x86_64 #1 SMP Mon Oct 23 13:41:58
                              UTC 2017 x86_64 x86_64
Alert Count                   2567
First Seen                    2018-01-25 11:44:43 CET
Last Seen                     2018-01-25 15:29:17 CET
Local ID                      756b0f90-3fa0-49bc-b160-973945fe05fe

Raw Audit Messages
type=AVC msg=audit(1516890557.787:20821): avc:  denied  { map } for  pid=31329 comm="mysqld" path="/usr/sbin/mysqld" dev="vda1" ino=142762 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:mysqld_exec_t:s0 tclass=file permissive=0


Hash: mysqld,init_t,mysqld_exec_t,file,map
  • Does it work if you disable SELinux, or if you put it into permissive mode? – dbdemon Jan 25 '18 at 17:36
  • What happens when you run the ausearch command? You may have better luck at getting answers e.g. over on serverfault.com since this is really more of a Linux question. – dbdemon Jan 26 '18 at 9:17
  • @dbdemon ausearch keeps spitting out a message to activate a policy package: semodule -i my-mysqld.pp which I did but doesn't seem to work. Also I do not know how to move the question over to serverfault. – Dark Star1 Jan 28 '18 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.