Changeset 2701

Show
Ignore:
Timestamp:
03/10/08 23:41:04 (9 months ago)
Author:
dhozac
Message:

bash doesn't execute traps until after the current job has finished executing, so run sleep in a loop.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/scripts/vserver-build.functions

    r2698 r2701  
    270270        exec 2> /dev/null 
    271271        trap 'kill -s 9 -- -1; exit 0' INT 
    272         sleep $timeout 
     272        i=0 
     273        while [ \$i -lt $timeout ]; do 
     274            sleep 1 
     275            let ++i 
     276        done 
    273277        kill -s 15 -- -1 
    274278        sleep 1 
     
    279283{ 
    280284    local guest="$1" 
    281     $_VKILL --xid "$guest" -s INT -- 0 
    282 } 
     285    $_VKILL --xid "$guest" -s INT -- 1 
     286}