#!/bin/sh # chkconfig: 345 99 01 # description: The vservers service is used to start and stop all # the virtual servers. USR_SBIN=/usr/sbin VROOTDIR=/vservers # Print the vserver name in priority/alpha order sortserver(){ ( cd /etc/vservers for serv in *.conf ; do # XXX - why is this check necessary? test -f "$serv" || continue PRIORITY=100 . $serv echo $PRIORITY `basename $serv .conf` done ) | sort -n $* | cut -d ' ' -f 2 } startservers(){ echo "Starting the virtual servers" cd /etc/vservers for name in $*; do if ! test -f "$name.conf" ; then echo No configuration for this vserver: /etc/vservers/$name.conf continue fi ONBOOT= BACKGROUND=no if [ -f /etc/vservers.conf ] ; then . /etc/vservers.conf fi . $name.conf if [ "$ONBOOT" = "yes" ] ; then mkdir -p $VROOTDIR/$name/var/log if [ "$BACKGROUND" = "yes" ] ; then nohup setsid $USR_SBIN/vserver $name start >$VROOTDIR/$name/var/log/boot.log 2>&1 &1