1

This is not the same as the linked question. This has been working for years, and is still installed

I'm not so experienced with Ubuntu. But I had a server running a MySQL database for a client of mine, and suddenly it stopped working. I restarted the server and the problem still persists.

When I try to start my MySQL server I get this message:

Job for mysql.service failed because the control process exited with error code.

Running systemctl status mysql.service

# sudo systemctl status mysql.service
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Wed 2018-10-24 15:46:02 CEST; 20s ago
  Process: 24864 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 24854 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 24864 (code=exited, status=1/FAILURE);         : 24865 (mysql-systemd-s)
    Tasks: 2
   Memory: 324.0K
      CPU: 327ms
   CGroup: /system.slice/mysql.service
           └─control
             ├─24865 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─24937 sleep 1

Running


# sudo systemctl status mysql.service

    ● mysql.service - MySQL Community Server
       Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
       Active: activating (start-post) (Result: exit-code) since Wed 2018-10-24 15:46:02 CEST; 20s ago
      Process: 24864 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
      Process: 24854 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
     Main PID: 24864 (code=exited, status=1/FAILURE);         : 24865 (mysql-systemd-s)
        Tasks: 2
       Memory: 324.0K
          CPU: 327ms
       CGroup: /system.slice/mysql.service
               └─control
                 ├─24865 /bin/bash /usr/share/mysql/mysql-systemd-start post
                 └─24937 sleep 1

    Oct 24 15:46:02 <ip-removed> systemd[1]: Starting MySQL Community Server...
    Oct 24 15:46:04 <ip-removed> systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

# sudo journalctl -xe
    -- Unit mysql.service has finished shutting down.
    Oct 24 15:50:36 <ip-removed> systemd[1]: Starting MySQL Community Server...
    -- Subject: Unit mysql.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit mysql.service has begun starting up.
    Oct 24 15:50:36 <ip-removed> kernel: audit: type=1400 audit(1540389036.856:1363): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/26027/status" pid=26027 comm="
    Oct 24 15:50:36 <ip-removed> kernel: audit: type=1400 audit(1540389036.856:1364): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=26027
    Oct 24 15:50:36 <ip-removed> kernel: audit: type=1400 audit(1540389036.856:1365): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/26027/status" pid=26027 comm="
    Oct 24 15:50:36 <ip-removed> audit[26027]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/26027/status" pid=26027 comm="mysqld" requested_mask="r" denied_m
    Oct 24 15:50:36 <ip-removed> audit[26027]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=26027 comm="mysqld" requested_mask="r" d
    Oct 24 15:50:36 <ip-removed> audit[26027]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/26027/status" pid=26027 comm="mysqld" requested_mask="r" denied_m
    Oct 24 15:50:38 <ip-removed> systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
    Oct 24 15:50:44 <ip-removed> sshd[26071]: Invalid user dab from 149.202.149.48
    Oct 24 15:50:44 <ip-removed> sshd[26071]: input_userauth_request: invalid user dab [preauth]
    Oct 24 15:50:44 <ip-removed> sshd[26071]: pam_unix(sshd:auth): check pass; user unknown
    Oct 24 15:50:44 <ip-removed> sshd[26071]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=149.202.149.48
    Oct 24 15:50:46 <ip-removed> sshd[26071]: Failed password for invalid user dab from 149.202.149.48 port 35462 ssh2
    Oct 24 15:50:46 <ip-removed> sshd[26071]: Received disconnect from 149.202.149.48 port 35462:11: Normal Shutdown, Thank you for playing [preauth]
    Oct 24 15:50:46 <ip-removed> sshd[26071]: Disconnected from 149.202.149.48 port 35462 [preauth]
    Oct 24 15:50:49 <ip-removed> sudo[26085]:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/journalctl -xe
    Oct 24 15:50:49 <ip-removed> sudo[26085]: pam_unix(sudo:session): session opened for user root by root(uid=0)

I allowed read to files that were blocked, and stumbled on a different set of errors

-- Unit mysql.service has begun starting up.
Oct 24 18:01:20 vps437776 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Oct 24 18:01:22 vps437776 postfix/smtpd[17615]: connect from unknown[194.53.142.88]
Oct 24 18:01:27 vps437776 saslauthd[1611]: pam_unix(smtp:auth): check pass; user unknown
Oct 24 18:01:27 vps437776 saslauthd[1611]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
Oct 24 18:01:30 vps437776 saslauthd[1611]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
Oct 24 18:01:30 vps437776 saslauthd[1611]: do_auth         : auth failure: [[email protected]] [service=smtp] [realm=ovh.net] [mech=pam] [reason=PAM auth error]
Oct 24 18:01:30 vps437776 postfix/smtpd[17615]: warning: unknown[194.53.142.88]: SASL LOGIN authentication failed: authentication failure
Oct 24 18:01:30 vps437776 postfix/smtpd[17615]: disconnect from unknown[194.53.142.88] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Oct 24 18:01:34 vps437776 postfix/smtpd[21860]: connect from unknown[194.53.142.89]
Oct 24 18:01:35 vps437776 sshd[23609]: Invalid user operator from 149.202.149.48
Oct 24 18:01:35 vps437776 sshd[23609]: input_userauth_request: invalid user operator [preauth]
Oct 24 18:01:35 vps437776 sshd[23609]: pam_unix(sshd:auth): check pass; user unknown
Oct 24 18:01:35 vps437776 sshd[23609]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=149.202.149.48
Oct 24 18:01:36 vps437776 postfix/smtpd[18999]: connect from unknown[194.53.142.55]
Oct 24 18:01:37 vps437776 sshd[23609]: Failed password for invalid user operator from 149.202.149.48 port 59606 ssh2
Oct 24 18:01:37 vps437776 sshd[23609]: Received disconnect from 149.202.149.48 port 59606:11: Normal Shutdown, Thank you for playing [preauth]
Oct 24 18:01:37 vps437776 sshd[23609]: Disconnected from 149.202.149.48 port 59606 [preauth]
Oct 24 18:01:39 vps437776 saslauthd[1612]: pam_unix(smtp:auth): check pass; user unknown
Oct 24 18:01:39 vps437776 saslauthd[1612]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
Oct 24 18:01:40 vps437776 saslauthd[1610]: pam_unix(smtp:auth): check pass; user unknown
Oct 24 18:01:40 vps437776 saslauthd[1610]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
Oct 24 18:01:42 vps437776 saslauthd[1612]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
Oct 24 18:01:42 vps437776 saslauthd[1612]: do_auth         : auth failure: [[email protected]] [service=smtp] [realm=ovh.net] [mech=pam] [reason=PAM auth error]
Oct 24 18:01:42 vps437776 postfix/smtpd[21860]: warning: unknown[194.53.142.89]: SASL LOGIN authentication failed: authentication failure
Oct 24 18:01:42 vps437776 postfix/smtpd[21860]: disconnect from unknown[194.53.142.89] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Oct 24 18:01:43 vps437776 saslauthd[1610]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
Oct 24 18:01:43 vps437776 saslauthd[1610]: do_auth         : auth failure: [[email protected]] [service=smtp] [realm=ovh.net] [mech=pam] [reason=PAM auth error]
Oct 24 18:01:43 vps437776 postfix/smtpd[18999]: warning: unknown[194.53.142.55]: SASL LOGIN authentication failed: authentication failure
Oct 24 18:01:44 vps437776 postfix/smtpd[18999]: disconnect from unknown[194.53.142.55] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Oct 24 18:01:49 vps437776 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
Oct 24 18:01:49 vps437776 systemd[1]: mysql.service: Unit entered failed state.
Oct 24 18:01:49 vps437776 systemd[1]: mysql.service: Failed with result 'exit-code'.
Oct 24 18:01:49 vps437776 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Oct 24 18:01:49 vps437776 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
Oct 24 18:01:49 vps437776 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
Oct 24 18:01:51 vps437776 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Oct 24 18:02:08 vps437776 postfix/smtpd[17615]: connect from unknown[194.53.142.55]
Oct 24 18:02:11 vps437776 sshd[23769]: Invalid user apache from 149.202.149.48
Oct 24 18:02:11 vps437776 sshd[23769]: input_userauth_request: invalid user apache [preauth]
Oct 24 18:02:11 vps437776 sshd[23769]: pam_unix(sshd:auth): check pass; user unknown
Oct 24 18:02:11 vps437776 sshd[23769]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=149.202.149.48
Oct 24 18:02:13 vps437776 sshd[23769]: Failed password for invalid user apache from 149.202.149.48 port 58802 ssh2
Oct 24 18:02:13 vps437776 sshd[23769]: Received disconnect from 149.202.149.48 port 58802:11: Normal Shutdown, Thank you for playing [preauth]
Oct 24 18:02:13 vps437776 sshd[23769]: Disconnected from 149.202.149.48 port 58802 [preauth]
Oct 24 18:02:13 vps437776 saslauthd[1609]: pam_unix(smtp:auth): check pass; user unknown
Oct 24 18:02:13 vps437776 saslauthd[1609]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
Oct 24 18:02:15 vps437776 saslauthd[1609]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
Oct 24 18:02:15 vps437776 saslauthd[1609]: do_auth         : auth failure: [[email protected]] [service=smtp] [realm=ovh.net] [mech=pam] [reason=PAM auth error]
Oct 24 18:02:15 vps437776 postfix/smtpd[17615]: warning: unknown[194.53.142.55]: SASL LOGIN authentication failed: authentication failure
Oct 24 18:02:16 vps437776 postfix/smtpd[17615]: disconnect from unknown[194.53.142.55] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Oct 24 18:02:17 vps437776 postfix/smtpd[21860]: connect from unknown[194.53.142.88]
Oct 24 18:02:17 vps437776 sudo[23783]:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/journalctl -xe
Oct 24 18:02:17 vps437776 sudo[23783]: pam_unix(sudo:session): session opened for user root by root(uid=0)

sudo aa-status | grep 'profile\|process\|mysql'

root@vps437776:~# sudo aa-status | grep 'profile\|process\|mysql'
17 profiles are loaded.
17 profiles are in enforce mode.
   /usr/sbin/mysqld
0 profiles are in complain mode.
3 processes have profiles defined.
3 processes are in enforce mode.
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
4
  • 4
    Possible duplicate of MySQL won't start because of AppArmor?
    – user535733
    Oct 24, 2018 at 14:02
  • 1
    "his is not the same as the linked thread. This has been working for years, and is still installed" And I claim it is the same: see your log: AVC apparmor="DENIED" and Invalid user dab from 149.202.149.48 Someone changed settings on that server and apparmor is refusing to execute mysql due to those changes.
    – Rinzwind
    Oct 24, 2018 at 14:37
  • Don't use sudo as root. Use sudo within your username. Please post the output of sudo aa-status | grep 'profile\|process\|mysql'
    – abu_bua
    Oct 24, 2018 at 14:59
  • I have updated the question with more logs after completing steps in the duplicate thread... Oct 24, 2018 at 16:09

0

You must log in to answer this question.

Browse other questions tagged .