Changeset 2600

Show
Ignore:
Timestamp:
08/27/07 12:16:40 (1 year ago)
Author:
dhozac
Message:

Be more like the redhat initpost script, don't start the guest for real.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/distrib/debian/initpost

    r2571 r2600  
    2525 
    2626# vserver name 
    27 NAME=$(< "$cfgdir"/name) 
     27NAME="$cfgdir" 
    2828 
    2929 
     
    104104fi 
    105105 
    106 # from here on we need to do things live in the server 
    107 $_CHROOT_SH truncate   /vserver-config.sh < "$__DISTRIBDIR"/etch/vserver-config.sh 
    108 $_CHROOT_SH chmod 0755 /vserver-config.sh 
    109  
    110106echo 
    111107echo ">>> Executing post install script ... " 
     
    113109 
    114110# start vserver before we can exec anything inside it 
    115 vserver $NAME start 
     111$_VSERVER "$NAME" stop &>/dev/null || : 
     112$_VSERVER "$NAME" start --rescue --rescue-init bash -c ' 
     113    exec  > /dev/null 
     114    exec 2> /dev/null 
     115 
     116    set -x 
     117    f=/tmp/startwait 
     118    trap "rm -f $f" EXIT 
     119    mkfifo $f 
     120    ( sleep 15; kill -s 9 -- -1 ) & 
     121    cat "$f" 
     122    kill -s 9 -- -1 
     123    wait 
     124
    116125 
    117126# run the configure commands from within the server 
    118 vserver $NAME exec /vserver-config.sh 
    119 $_CHROOT_SH rm /vserver-config.sh 
     127export LANG=C LC_ALL=C 
     128 
     129$_CHROOT_SH testfile /usr/sbin/locale-gen && \ 
     130    $_VSERVER "$NAME" exec /usr/sbin/locale-gen 
     131 
     132for i in bootlogd checkfs checkroot halt hwclock.sh ifupdown klogd \ 
     133         libdevmapper1.02 makedev module-init-tools mountall.sh \ 
     134         mountdevsubfs.sh mountnfs.sh mountkernfs.sh mountvirtfs \ 
     135         networking reboot setserial single stop-bootlogd \ 
     136         stop-bootlogd-single umountfs umountnfs.sh umountroot \ 
     137         urandom; do 
     138    $_VSERVER "$NAME" exec update-rc.d -f "$i" remove 
     139done 
    120140 
    121141# stop the vserver 
    122 vserver $NAME stop 
     142$_VSERVER "$NAME" exec bash -c ': >/tmp/startwait' &>/dev/null || : 
     143$_VSERVER "$NAME" stop &>/dev/null || : 
    123144 
    124145popd &>/dev/null