--- a/files/init.d-2.2 2018-04-26 10:56:44.452592421 -0400 +++ b/files/init.d-2.2 2018-04-26 11:55:20.408548260 -0400 @@ -74,6 +74,7 @@ fi # tail -n1 is critical as these we only want the last instance of the option + local user=$(get_config "${MY_CNF}" user | tail -n1) local basedir=$(get_config "${MY_CNF}" basedir | tail -n1) local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1) local socket=$(get_config "${MY_CNF}" socket | tail -n1) @@ -113,7 +114,7 @@ fi local piddir="${pidfile%/*}" - checkpath -d --owner mysql:mysql --mode 0755 "$piddir" + checkpath -d --owner "${user}" --mode 0755 "$piddir" rc=$? if [ $rc -ne 0 ]; then eerror "Directory $piddir for pidfile does not exist and cannot be created" @@ -127,6 +128,7 @@ start-stop-daemon \ ${DEBUG:+"--verbose"} \ --start \ + --user "${user}" \ --exec "${basedir}"/sbin/mysqld \ --pidfile "${pidfile}" \ --background \