From: Silvio Rhatto Date: Mon, 30 Mar 2009 01:19:20 +0000 (-0300) Subject: fixes for mysql handler for mysqld inside a vserver X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=commitdiff_plain;h=64edfccf7684d9c080e734b25fa9361f0190afec fixes for mysql handler for mysqld inside a vserver --- diff --git a/handlers/mysql.in b/handlers/mysql.in index fe1e783..6e894fe 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -88,8 +88,7 @@ if [ "$dbusername" != "" -a "$dbpassword" != "" ] then if [ $usevserver = yes ] then - vhome=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` - home="$vroot$vhome" + home=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` else home=`getent passwd "root" | @AWK@ -F: '{print $6}'` fi @@ -97,18 +96,25 @@ then [ -d $home ] || fatal "Can't find root's home directory ($home)." mycnf="$home/.my.cnf" - - if [ -f $mycnf ] + + if [ $usevserver = yes ] + then + workcnf="$vroot$mycnf" + else + workcnf="$mycnf" + fi + + if [ -f $workcnf ] then - # rename temporarily - tmpcnf="$home/my.cnf.disable" - debug "mv $mycnf $tmpcnf" - mv $mycnf $tmpcnf + # rename temporarily + tmpcnf="$workcnf.disable" + debug "mv $workcnf $tmpcnf" + mv $workcnf $tmpcnf fi oldmask=`umask` umask 077 - cat > $mycnf < $workcnf <