X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sysv%2Fvservers.subst;fp=sysv%2Fvservers.subst;h=f5bd28aab376dc61b9752c6a05cd57321655cfd7;hb=c3b69289e118fb13af3615001c94f2d30384842f;hp=523f4fa3df81c0ccad5593ab5b3ae28de37468e8;hpb=29b1465147f2a9fd2842bbf7f342a067ba258813;p=util-vserver.git diff --git a/sysv/vservers.subst b/sysv/vservers.subst index 523f4fa..f5bd28a 100755 --- a/sysv/vservers.subst +++ b/sysv/vservers.subst @@ -4,6 +4,7 @@ # the virtual servers. USR_SBIN=/usr/sbin +CHCONTEXT="$USR_SBIN/chcontext --silent --secure --ctx" VROOTDIR=/vservers # Print the vserver name in priority/alpha order @@ -11,45 +12,19 @@ sortserver(){ ( cd /etc/vservers for serv in *.conf ; do + # XXX - why is this check necessary? test -f "$serv" || continue PRIORITY=100 . $serv - printf "%03d %s\n" $PRIORITY `basename $serv .conf` - done - ) | sort $* | (while read a b; do echo $b; done) -} - -startservers(){ - echo "Starting the virtual servers" - cd /etc/vservers - for name in ${*:-`sortserver`} ; 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