Skip to content
Snippets Groups Projects
Commit d600ba40 authored by intrigeri's avatar intrigeri
Browse files

handlers/pgsql: make more use of the new lib/vserver functionality

parent e5098e0c
No related branches found
No related tags found
No related merge requests found
...@@ -10,12 +10,12 @@ getconf vsname ...@@ -10,12 +10,12 @@ getconf vsname
localhost=`hostname` localhost=`hostname`
# If vservers are configured, decide if the handler should # If vservers are enabled, check that $vsname exists, and decide if the
# use them or if it should just operate on the host # handler should use it or if it should just operate on the host.
local usevserver=no local usevserver=no
if [ $vservers_are_available = yes ]; then if [ $vservers_are_available = yes ]; then
if ! vservers_exist "$vsname" ; then if ! vservers_exist "$vsname" ; then
fatal "At least one of the vservers listed in vsnames ($vsnames) does not exist." fatal "The vserver given in vsname ($vsname) does not exist."
else else
info "using vserver '$vsname'" info "using vserver '$vsname'"
usevserver=yes usevserver=yes
...@@ -23,13 +23,11 @@ if [ $vservers_are_available = yes ]; then ...@@ -23,13 +23,11 @@ if [ $vservers_are_available = yes ]; then
fi fi
# As needed, make sure that : # As needed, make sure that :
# * the specified vserver exists and is running # * the specified vserver is running
# * the specified vserver or host has the needed executables # * the specified vserver or host has the needed executables
if [ $usevserver = yes ]; then if [ $usevserver = yes ]; then
info "examining vserver '$vsname'" info "examining vserver '$vsname'"
# does it exist ?
vroot="$VROOTDIR/$vsname" vroot="$VROOTDIR/$vsname"
[ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
# is it running ? # is it running ?
running=`$VSERVERINFO $vsname RUNNING` running=`$VSERVERINFO $vsname RUNNING`
if [ "$running" = "1" ]; then if [ "$running" = "1" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment