Bug #88532 Ubuntu init script should use --user option of mysqld_safe.
Submitted: 17 Nov 2017 8:40
Reporter: Takanori Sejima Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.7.20, 8.0.3 OS:Ubuntu (14.04)
Assigned to: CPU Architecture:Any

[17 Nov 2017 8:40] Takanori Sejima
Description:
Ubuntu init script specifies mysql user with su command, not --user option of mysqld_safe. Therefore, even if open_files_limit is set in my.cnf, it can not be reflected.

I checked with mysql-server_5.7.20-1ubuntu14.04_amd64.deb-bundle.tar and mysql-server_8.0.3-rc-1ubuntu14.04_amd64.deb-bundle.tar.

How to repeat:
1. Write the following setting in my.cnf.

[mysqld_safe]
open_files_limit = 65535

2. sudo /etc/init.d/mysql restart

3. But open_files_limit is not reflected.

Suggested fix:
For example:

$ diff -u etc/init.d/mysql /etc/init.d/
--- etc/init.d/mysql    2017-09-14 01:48:12.000000000 +0900
+++ /etc/init.d/mysql   2017-11-17 17:14:52.305257838 +0900
@@ -62,7 +62,7 @@

                /lib/init/apparmor-profile-load usr.sbin.mysqld

-               su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
+               su - -s /bin/bash -c "mysqld_safe --user=mysql > /dev/null &"
                verify_server start
                if [ "$?" -eq 0 ];
                then
$