3 # description: The vservers service is used to start and stop all
6 . /etc/init.d/functions
8 . /etc/sysconfig/vservers-legacy
10 [ -n "$UTIL_VSERVER_VARS" ] || UTIL_VSERVER_VARS=/usr/lib/util-vserver/util-vserver-vars
11 if [ ! -e "$UTIL_VSERVER_VARS" ] ; then
12 echo "Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
15 . "$UTIL_VSERVER_VARS"
17 # Print the vserver name in priority/alpha order
23 test -f "$serv" || continue
27 test "$ONBOOT" || continue
28 printf "%03d %s\n" $PRIORITY `basename $serv .conf`
30 ) | sort $* | (while read a b; do echo $b; done)
35 for name in `sortserver`
39 if [ "$ONBOOT" = "yes" ] ; then
40 $_VSERVER_LEGACY $name start
45 # See how we were called.
48 if [ ! -f /var/lock/subsys/vservers-legacy ] ; then
49 show "Starting the virtual servers"
51 if [ "$BACKGROUND" = "yes" ] ; then
52 startservers >/dev/tty8 </dev/tty8 2>/dev/tty8 &
56 touch /var/lock/subsys/vservers-legacy
59 msg_already_running "virtual servers"
63 if [ -f /var/lock/subsys/vservers-legacy ] ; then
64 show "Stopping the virtual servers"
67 for name in `sortserver -r` ; do
68 $_VSERVER_LEGACY $name stop
70 rm -f /var/lock/subsys/vservers-legacy
73 msg_not_running "virtual servers"
81 if [ -f /var/lock/subsys/vservers-legacy ] ; then
83 for serv in *.conf ; do
85 name=`basename $serv .conf`
87 echo -n ONBOOT=$ONBOOT " "
88 $_VSERVER_LEGACY $name running
91 msg_not_running "virtual servers"
95 echo "Usage: vservers {start|stop|restart|status}"
101 # This must be last line !
102 # vi:syntax=sh:tw=78:ts=8:sw=4