commit/galaxy-central: 4 new changesets
4 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/1333f32a5063/ Changeset: 1333f32a5063 User: nsoranzo Date: 2015-02-02 15:46:48+00:00 Summary: Allow "GALAXY_RUN_ALL=1 ./run.sh restart" since --daemon is implied. Affected #: 1 file diff -r 5aca28ab8cfbbc1769f68fcfacf3dfbf9352ccde -r 1333f32a50639a2d2dfaca327b20520da358721c run.sh --- a/run.sh +++ b/run.sh @@ -44,9 +44,9 @@ if [ -n "$GALAXY_RUN_ALL" ]; then servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' $GALAXY_CONFIG_FILE | xargs echo` - daemon=`echo "$@" | grep -q daemon` + echo "$@" | grep -q 'daemon\|restart' if [ $? -ne 0 ]; then - echo 'ERROR: $GALAXY_RUN_ALL cannot be used without the `--daemon` or `--stop-daemon` arguments to run.sh' + echo 'ERROR: $GALAXY_RUN_ALL cannot be used without the `--daemon`, `--stop-daemon` or `restart` arguments to run.sh' exit 1 fi for server in $servers; do @@ -54,5 +54,6 @@ python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log $@ done else + # Handle only 1 server, whose name can be specified with --server-name parameter (defaults to "main") python ./scripts/paster.py serve $GALAXY_CONFIG_FILE $@ fi https://bitbucket.org/galaxy/galaxy-central/commits/6d11484ceb7d/ Changeset: 6d11484ceb7d User: nsoranzo Date: 2015-02-02 16:08:13+00:00 Summary: Merge rolling_restart.sh in run.sh by adding --wait parameter. Also add the following combination: GALAXY_RUN_ALL=1 ./run.sh --daemon --wait which, by preventing servers from starting simultaneously, is useful when multiple servers are configured before creating the database, or when updating to a new Galaxy release containing a database upgrade. Affected #: 2 files diff -r 1333f32a50639a2d2dfaca327b20520da358721c -r 6d11484ceb7d797f5571df24a147d3f59f8ee553 rolling_restart.sh --- a/rolling_restart.sh +++ b/rolling_restart.sh @@ -1,61 +1,3 @@ #!/bin/sh -cd `dirname $0` - -# If there is a .venv/ directory, assume it contains a virtualenv that we -# should run this instance in. -if [ -d .venv ]; -then - . .venv/bin/activate -fi - -python ./scripts/check_python.py -[ $? -ne 0 ] && exit 1 - -./scripts/common_startup.sh - -if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then - python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR" -fi - -if [ -z "$GALAXY_CONFIG_FILE" ]; then - if [ -f universe_wsgi.ini ]; then - GALAXY_CONFIG_FILE=universe_wsgi.ini - elif [ -f config/galaxy.ini ]; then - GALAXY_CONFIG_FILE=config/galaxy.ini - else - GALAXY_CONFIG_FILE=config/galaxy.ini.sample - fi - export GALAXY_CONFIG_FILE -fi - -servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' $GALAXY_CONFIG_FILE | xargs echo` -for server in $servers; do - # If there's a pid - if [ -e $server.pid ]; then - # Then kill it - echo "Killing $server" - pid=`cat $server.pid` - kill $pid - else - # Otherwise just continue - echo "$server not running" - fi - # Start the server (and background) (should this be nohup'd?) - python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log --daemon $@ - while true; do - sleep 1 - printf "." - # Grab the current pid from the pid file - if ! current_pid_in_file=$(cat $server.pid); then - echo "A Galaxy process died, interrupting" >&2 - exit 1 - fi - # Search for all pids in the logs and tail for the last one - latest_pid=`egrep '^Starting server in PID [0-9]+\.$' $server.log -o | sed 's/Starting server in PID //g;s/\.$//g' | tail -n 1` - # If they're equivalent, then the current pid file agrees with our logs - # and we've succesfully started - [ -n "$latest_pid" ] && [ $latest_pid -eq $current_pid_in_file ] && break - done - echo -done +GALAXY_RUN_ALL=1 ./run.sh restart --wait diff -r 1333f32a50639a2d2dfaca327b20520da358721c -r 6d11484ceb7d797f5571df24a147d3f59f8ee553 run.sh --- a/run.sh +++ b/run.sh @@ -49,9 +49,31 @@ echo 'ERROR: $GALAXY_RUN_ALL cannot be used without the `--daemon`, `--stop-daemon` or `restart` arguments to run.sh' exit 1 fi + (echo "$@" | grep -q -e '--daemon\|restart') && (echo "$@" | grep -q -e '--wait') + WAIT=$? + ARGS=`echo "$@" | sed 's/--wait//'` for server in $servers; do - echo "Handling $server with log file $server.log..." - python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log $@ + if [ $WAIT -eq 0 ]; then + python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log $ARGS + while true; do + sleep 1 + printf "." + # Grab the current pid from the pid file + if ! current_pid_in_file=$(cat $server.pid); then + echo "A Galaxy process died, interrupting" >&2 + exit 1 + fi + # Search for all pids in the logs and tail for the last one + latest_pid=`egrep '^Starting server in PID [0-9]+\.$' $server.log -o | sed 's/Starting server in PID //g;s/\.$//g' | tail -n 1` + # If they're equivalent, then the current pid file agrees with our logs + # and we've succesfully started + [ -n "$latest_pid" ] && [ $latest_pid -eq $current_pid_in_file ] && break + done + echo + else + echo "Handling $server with log file $server.log..." + python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log $@ + fi done else # Handle only 1 server, whose name can be specified with --server-name parameter (defaults to "main") https://bitbucket.org/galaxy/galaxy-central/commits/d9c2dce96ec4/ Changeset: d9c2dce96ec4 User: nsoranzo Date: 2015-02-02 17:30:03+00:00 Summary: Restore a line deleted by mistake. Thanks John. Affected #: 1 file diff -r 6d11484ceb7d797f5571df24a147d3f59f8ee553 -r d9c2dce96ec4376816a0bf23b4ba956616b63a48 rolling_restart.sh --- a/rolling_restart.sh +++ b/rolling_restart.sh @@ -1,3 +1,5 @@ #!/bin/sh +cd `dirname $0` + GALAXY_RUN_ALL=1 ./run.sh restart --wait https://bitbucket.org/galaxy/galaxy-central/commits/e56a78608c79/ Changeset: e56a78608c79 User: dannon Date: 2015-02-02 20:22:32+00:00 Summary: Merged in nsoranzo/galaxy-central (pull request #656) Merge rolling_restart.sh in run.sh by adding --wait parameter. Affected #: 2 files diff -r 8d74daa932a06f7bbd3e357f8216c8f58ae55965 -r e56a78608c79097a6227f8c06cba8a45580a2a7d rolling_restart.sh --- a/rolling_restart.sh +++ b/rolling_restart.sh @@ -2,60 +2,4 @@ cd `dirname $0` -# If there is a .venv/ directory, assume it contains a virtualenv that we -# should run this instance in. -if [ -d .venv ]; -then - . .venv/bin/activate -fi - -python ./scripts/check_python.py -[ $? -ne 0 ] && exit 1 - -./scripts/common_startup.sh - -if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then - python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR" -fi - -if [ -z "$GALAXY_CONFIG_FILE" ]; then - if [ -f universe_wsgi.ini ]; then - GALAXY_CONFIG_FILE=universe_wsgi.ini - elif [ -f config/galaxy.ini ]; then - GALAXY_CONFIG_FILE=config/galaxy.ini - else - GALAXY_CONFIG_FILE=config/galaxy.ini.sample - fi - export GALAXY_CONFIG_FILE -fi - -servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' $GALAXY_CONFIG_FILE | xargs echo` -for server in $servers; do - # If there's a pid - if [ -e $server.pid ]; then - # Then kill it - echo "Killing $server" - pid=`cat $server.pid` - kill $pid - else - # Otherwise just continue - echo "$server not running" - fi - # Start the server (and background) (should this be nohup'd?) - python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log --daemon $@ - while true; do - sleep 1 - printf "." - # Grab the current pid from the pid file - if ! current_pid_in_file=$(cat $server.pid); then - echo "A Galaxy process died, interrupting" >&2 - exit 1 - fi - # Search for all pids in the logs and tail for the last one - latest_pid=`egrep '^Starting server in PID [0-9]+\.$' $server.log -o | sed 's/Starting server in PID //g;s/\.$//g' | tail -n 1` - # If they're equivalent, then the current pid file agrees with our logs - # and we've succesfully started - [ -n "$latest_pid" ] && [ $latest_pid -eq $current_pid_in_file ] && break - done - echo -done +GALAXY_RUN_ALL=1 ./run.sh restart --wait diff -r 8d74daa932a06f7bbd3e357f8216c8f58ae55965 -r e56a78608c79097a6227f8c06cba8a45580a2a7d run.sh --- a/run.sh +++ b/run.sh @@ -44,15 +44,38 @@ if [ -n "$GALAXY_RUN_ALL" ]; then servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' $GALAXY_CONFIG_FILE | xargs echo` - daemon=`echo "$@" | grep -q daemon` + echo "$@" | grep -q 'daemon\|restart' if [ $? -ne 0 ]; then - echo 'ERROR: $GALAXY_RUN_ALL cannot be used without the `--daemon` or `--stop-daemon` arguments to run.sh' + echo 'ERROR: $GALAXY_RUN_ALL cannot be used without the `--daemon`, `--stop-daemon` or `restart` arguments to run.sh' exit 1 fi + (echo "$@" | grep -q -e '--daemon\|restart') && (echo "$@" | grep -q -e '--wait') + WAIT=$? + ARGS=`echo "$@" | sed 's/--wait//'` for server in $servers; do - echo "Handling $server with log file $server.log..." - python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log $@ + if [ $WAIT -eq 0 ]; then + python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log $ARGS + while true; do + sleep 1 + printf "." + # Grab the current pid from the pid file + if ! current_pid_in_file=$(cat $server.pid); then + echo "A Galaxy process died, interrupting" >&2 + exit 1 + fi + # Search for all pids in the logs and tail for the last one + latest_pid=`egrep '^Starting server in PID [0-9]+\.$' $server.log -o | sed 's/Starting server in PID //g;s/\.$//g' | tail -n 1` + # If they're equivalent, then the current pid file agrees with our logs + # and we've succesfully started + [ -n "$latest_pid" ] && [ $latest_pid -eq $current_pid_in_file ] && break + done + echo + else + echo "Handling $server with log file $server.log..." + python ./scripts/paster.py serve $GALAXY_CONFIG_FILE --server-name=$server --pid-file=$server.pid --log-file=$server.log $@ + fi done else + # Handle only 1 server, whose name can be specified with --server-name parameter (defaults to "main") python ./scripts/paster.py serve $GALAXY_CONFIG_FILE $@ fi Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org