#!/bin/sh
-# chkconfig: 345 98 10
+# chkconfig: 345 99 01
# description: The vservers service is used to start and stop all
# the virtual servers.
startservers(){
echo "Starting the virtual servers"
cd /etc/vservers
- for name in `sortserver`
+ for name in ${*:-`sortserver`}
do
+ if ! test -f "$name.conf" ; then
+ echo No configuration for this vserver: /etc/vservers/$name.conf
+ continue
+ fi
ONBOOT=
. $name.conf
if [ "$ONBOOT" = "yes" ] ; then
# See how we were called.
case "$1" in
start)
+ shift
if [ "$BACKGROUND" = "yes" ] ; then
- startservers >/dev/tty8 </dev/tty8 2>/dev/tty8 &
+ startservers $* >/dev/tty8 </dev/tty8 2>/dev/tty8 &
else
- startservers
+ startservers $*
fi
touch /var/lock/subsys/vservers
;;
stop)
+ shift
echo "Stopping the virtual servers"
cd /etc/vservers
- for name in `sortserver -r`
+ for name in ${*:-`sortserver -r`}
do
$USR_SBIN/vserver $name stop
done
rm -f /var/lock/subsys/vservers
;;
- restart)
- $0 stop
- $0 start
+ restart|force-reload)
+ shift
+ $0 stop $*
+ $0 start $*
;;
reload)
echo Not implemented