We had been creating "rundir" but it was never used, probably leftover
from some removed function. At the same time, we were setting quite
strict rights to the socket directory (while comments sugested
otherwise).
Signed-off-by: Michal Hrusecky <michal@hrusecky.net>
(cherry picked from commit
8f6831b64b89243e7c1be5948f33e6737f7ddfc3)
start_service() {
conf=/etc/mysql/my.cnf
logdir=/var/log/mysql
- rundir=/var/run/mysqld
version="$(mysqld --version | sed -n 's|.*Ver[[:blank:]]*\([0-9.]*\)-.*|\1|p')"
# Few basic checks
fi
# Make sure all required directories exists and have correct rights
- for i in "$logdir" "$rundir" "$sockdir"; do
+ for i in "$logdir" "$sockdir"; do
opts="-m 0750"
if ! [ -e "$i" ]; then
- # $rundir needs to be accessible for
- # clients
- if [ "$i" = "$rundir" ]; then
- opts=
- fi
+ # $sockdir needs to be accessible for clients
+ [ "$i" = "$sockdir" ] && opts="-m 0755"
# shellcheck disable=SC2086
mkdir -p $opts "$i"
fi