diff --git a/releng.control/cc.sh b/releng.control/cc.sh index cd3026117a06e50d0686c9419c7959cce8c9c8a9..c5d4edc1c7ad843f857343eac4f682fff4807413 100644 --- a/releng.control/cc.sh +++ b/releng.control/cc.sh @@ -13,7 +13,10 @@ fi XVFBSCREEN=${BUILD_HOME}/tmp mkdir -p ${XVFBSCREEN} -/usr/bin/Xvfb :$DISPLAYNUMBER -screen 0 1600x1200x24 -reset -fbdir ${XVFBSCREEN} & +/usr/bin/Xvfb :$DISPLAYNUMBER -screen 0 1600x1200x24 -ld 10240000 -ls 1024000 -lf 20 -reset -fbdir ${XVFBSCREEN} & +echo $! > ccxvfb.pid + + echo "ulimit: " `ulimit -n` @@ -61,4 +64,30 @@ echo " LOCAL_BUILD_PROPERTIES_DIR: ${LOCAL_BUILD_PROPERTIES_DIR}" echo echo " remember to check that X virtual frame buffer is running for display :$DISPLAYNUMBER for headless unit tests"; ps -ef | grep Xvfb -echo +echo; + + + +PIDFILE=cc.xvfbpid +echo; +if [ -f ${PIDFILE} ] ; then + echo " Killing Xvfb process from PID file" + PID=`cat ${PIDFILE}` + kill -3 $PID + # if permission denied, for example, then be sure not to remove PID file + if [ $? ] + then + if kill -9 $PID ; then + echo " Xvfb process stopped" + rm -f ${PIDFILE} + else + echo " Xvfb process could not be stopped" + fi + else + echo " Could not kill the process." + fi +else + echo " PID file (${PIDFILE}) does not exist." + echo " Either Xvfb not running, or PID file has been deleted" +fi +echo;