Changeset 2566

Show
Ignore:
Timestamp:
07/18/07 19:24:36 (1 year ago)
Author:
dhozac
Message:

Add --strace and --debug-sysv options to further debug problems with starting a guest.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/scripts/vserver

    r2521 r2566  
    120120 
    121121OPTIONS_ORIG=( "$@" ) 
    122 tmp=$(getopt -o +sv --long nonamespace,--nonamespace,--insecure,defaulttty,help,debug,version,sync,verbose,silent -n "$0" -- "$@") || exit 1 
     122tmp=$(getopt -o +sv --long nonamespace,--nonamespace,--insecure,defaulttty,help,debug,strace,debug-sysv,version,sync,verbose,silent -n "$0" -- "$@") || exit 1 
    123123eval set -- "$tmp" 
    124124 
     
    130130OPTION_INSECURE= 
    131131OPTION_DEFAULTTTY= 
     132OPTION_STRACE= 
     133OPTION_DEBUG_SYSV= 
    132134 
    133135while true; do 
     
    142144        (--defaulttty)  OPTION_DEFAULTTTY=$1;; 
    143145        (----insecure)  OPTION_INSECURE=1;; 
     146        (--strace)      OPTION_STRACE=1;; 
     147        (--debug-sysv*) OPTION_DEBUG_SYSV=$1;; 
    144148        (--)            shift; break;; 
    145149        (*)             echo $"vserver: internal error; arg=='$1'" >&2; exit 1;; 
  • trunk/scripts/vserver.functions

    r2548 r2566  
    280280            INITCMD_PREPARE=( $_FAKE_RUNLEVEL "$RUNLEVEL_START" /var/run/utmp ) 
    281281            OPTS_ENV=( "${OPTS_ENV[@]}" PREVLEVEL=N RUNLEVEL="$RUNLEVEL_START" ) 
     282            if test -n "$OPTION_DEBUG_SYSV"; then 
     283                INITCMD_START=( /bin/bash -x "${INITCMD_START[@]}" ) 
     284                INITCMD_STOP=( /bin/bash -x "${INITCMD_STOP[@]}" ) 
     285            fi 
    282286            ;; 
    283287             
  • trunk/scripts/vserver.start

    r2466 r2566  
    134134    $_EXEC_ULIMIT "$VSERVER_DIR"/ulimits \ 
    135135    $_VCONTEXT   --create "${OPTS_VCONTEXT_CREATE[@]}" -- \ 
     136    ${OPTION_STRACE:+$_STRACE -fF -o /tmp/vserver-start.$$} \ 
    136137    ${USE_VNAMESPACE:+$_VNAMESPACE --set -- } \ 
    137138    $_VLIMIT     --dir "$VSERVER_DIR"/rlimits --missingok -- \