Description:
Currently the init.d script, when execute as none 'super user' will not fail, but try to shutdown mysqld anyway.
How to repeat:
[geert@cent01 ~]$ /etc/init.d/mysql stop
cat: /var/lib/mysql/cent01.kemuri.net.pid: Permission denied
Shutting down MySQLkill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
..
Suggested fix:
Just test that the pid-file can be read by the current user before doing anything.
# If the manager pid_file doesn't exist, try the server's
if test ! -s "$pid_file"
then
pid_file=$server_pid_file
lock_dir=/var/lock/subsys/mysql
fi
if ! test -r $pid_file ;
then
log_failure_msg "Could not read PID (check permissions)"
exit 1
fi
Description: Currently the init.d script, when execute as none 'super user' will not fail, but try to shutdown mysqld anyway. How to repeat: [geert@cent01 ~]$ /etc/init.d/mysql stop cat: /var/lib/mysql/cent01.kemuri.net.pid: Permission denied Shutting down MySQLkill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] .. Suggested fix: Just test that the pid-file can be read by the current user before doing anything. # If the manager pid_file doesn't exist, try the server's if test ! -s "$pid_file" then pid_file=$server_pid_file lock_dir=/var/lock/subsys/mysql fi if ! test -r $pid_file ; then log_failure_msg "Could not read PID (check permissions)" exit 1 fi