script /scripts/mysqlup is causing binlog and relaylog to be owned by root

cornernote

Member
Nov 9, 2003
24
0
156
Hello,

I am finding that my MySQL binary and relay logs are CHOWNed by root instead of mysql. This caused replication to stop and gives me all kinds of headaches.

My mysql folder structure is non-standard, as follows:
/home/mysql/logs
/home/mysql/data
/home/mysql/tmp


I have isolated the issue to the cPanel update script "mysqlup":

- Daily script called by "cron":
/scripts/upcp

- Script called by "upcp":
/scripts/mysqlup

Here is some simple steps to replicate my issue.

[/home/mysql/logs]# ls -l
-rw-rw---- 1 mysql mysql 117 Feb 15 10:17 log-bin.000027
-rw-rw---- 1 mysql mysql 117 Feb 15 10:17 log-bin.000028
-rw-rw---- 1 mysql mysql 98 Feb 15 10:17 relay-log.000051
-rw-rw---- 1 mysql mysql 98 Feb 15 10:17 relay-log.000052

[/home/mysql/logs]# /scripts/mysqlup
MySQL Setup Script Version 7.0
Fetching http://httpupdate.cpanel.net/mysqlinstall/RELEASE/cPpkgversion (0)[email protected]%......Done
Loaded cPPkgs::MySQL ok!
This is the cPPkgs::MySQL 5.0.67 installer for Linux.
MySQL 5.0.67 is up to date
Unable to create mysql privileges database at /scripts/mysqlup line 605.
Install Complete

[/home/mysql/logs]# ls -l
-rw-rw---- 1 mysql mysql 117 Feb 15 10:17 log-bin.000027
-rw-rw---- 1 mysql mysql 117 Feb 15 10:17 log-bin.000028
-rw-rw---- 1 root root 117 Feb 15 10:22 log-bin.000029
-rw-rw---- 1 root root 117 Feb 15 10:22 log-bin.000030
-rw-rw---- 1 mysql mysql 98 Feb 15 10:17 relay-log.000051
-rw-rw---- 1 mysql mysql 98 Feb 15 10:17 relay-log.000052
-rw-rw---- 1 root root 98 Feb 15 10:22 relay-log.000053
-rw-rw---- 1 root root 98 Feb 15 10:22 relay-log.000054


Brett
 

cornernote

Member
Nov 9, 2003
24
0
156
I will try to keep this post in sync with the ticket I submitted...


Hi,

I am able to replicate your issue. I'm escalating this to level 3 for review
and resolution; thanks! In the meantime, you can put something like the
following in /scripts/postupcp (I've already added it for your convenience, and
am testing it now):

#!/bin/bash
# temporary fix for non-standard mysql directory.

for dir in data import tmp logs ; do

if [ -d "/home/mysql/${dir}" ]; then
chown -R mysql.mysql "/home/mysql/${dir}" &>/dev/null
fi

# end temp fix


Thanks; I'll get this issue escalated for review in the meantime.

--
Jamyn Shanley, Analyst
cPanel of Texas, Inc.