projects
/
matthijs
/
upstream
/
backupninja-vserver.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mysql and dup handlers: when using a vserver, check if it is running
[matthijs/upstream/backupninja-vserver.git]
/
handlers
/
mysql
diff --git
a/handlers/mysql
b/handlers/mysql
index a4a1497d35195acce702b887d0a1b4c266d855ba..e5306db4c5a42adafcafeb87e31f29f24c163328 100644
(file)
--- a/
handlers/mysql
+++ b/
handlers/mysql
@@
-28,7
+28,7
@@
fi
# If vservers are configured, decide if the handler should
# use them or if it should just operate on the host
# If vservers are configured, decide if the handler should
# use them or if it should just operate on the host
-if [ "$
VSERVERS
" = "yes" ]
+if [ "$
vservers
" = "yes" ]
then
if [ ! -z $vsname ]
then
then
if [ ! -z $vsname ]
then
@@
-39,11
+39,16
@@
then
fi
fi
fi
fi
-#
Check to make sure that the specified vserver exists
+#
If needed, make sure that the specified vserver exists and is running.
if [ $usevserver ]
then
if [ $usevserver ]
then
+ info "examining vserver '$vsname'"
+ # does it exist ?
vroot="$VROOTDIR/$vsname"
[ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
vroot="$VROOTDIR/$vsname"
[ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
+ # is it running ?
+ running=`$VSERVERINFO $vsname RUNNING`
+ [ $running = 1 ] || fatal "vserver $vsname is not running."
fi
# create backup dirs, the vroot variable will be empty if no vsname was specified
fi
# create backup dirs, the vroot variable will be empty if no vsname was specified