Changeset 1119 in svn for trunk


Ignore:
Timestamp:
2012-08-04T04:19:15+02:00 (3 years ago)
Author:
Xuefer
Message:

devel: improve fpm testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/devel/run

    r1113 r1119  
    11#!/bin/bash
    22# this script is for developers only
     3stopfpm() {
     4    if [[ -f $pidfile ]]; then
     5        pid=`cat $pidfile 2>/dev/null || true`
     6        if [[ $pid -gt 0 ]]; then
     7            echo
     8            echo Stopping fpm $pid @ $pidfile
     9            kill $pid || true
     10        fi
     11    fi
     12}
     13
    314set -e
    415MAKE=/usr/bin/make
     
    93104esac
    94105
     106case "${args[0]}" in
     107fpm)
     108    pidfile=devel.pid
     109    stopfpm
     110    ;;
     111stopfpm)
     112    pidfile=devel.pid
     113    stopfpm
     114    exit
     115    ;;
     116esac
     117
    95118basename=$(basename $(pwd))
    96119if echo $basename | grep -- - >/dev/null; then :; else
     
    112135xcachebasename=${basename%%-*}
    113136xcachesrcdir=../$xcachebasename
     137pidfile=../$xcachebasename/devel.pid
    114138
    115139case "$type" in
     
    192216        ;;
    193217    fpm)
    194         cmd=(./php-fpm -c devel.ini)
    195         args=(-y devel.fpm)
     218        echo Starting fpm ...
     219        cmd=(./php-fpm -c devel.ini -y devel.fpm -g $(readlink -f $pidfile))
     220        args=()
    196221        ;;
    197222    *)
     
    244269
    245270export XCACHE_SKIP_FCGI_WARNING=1
    246 echo "${tracer[@]}" "${cmd[@]}" "${args[@]}"
    247 exec "${tracer[@]}" "${cmd[@]}" "${args[@]}"
     271commandLine=("${tracer[@]}" "${cmd[@]}" "${args[@]}")
     272
     273case "${cmd[0]}" in
     274*php-fpm*)
     275    stopfpm
     276    "${commandLine[@]}"
     277    echo -n "Ctrl-C to stop"
     278    trap stopfpm SIGINT SIGTERM
     279    cat > /dev/null || true
     280    ;;
     281*)
     282    exec "${commandLine[@]}"
     283    ;;
     284esac
Note: See TracChangeset for help on using the changeset viewer.