From 2fd8e09c3de9ee539e47bdb416a4c0df89ff15ab Mon Sep 17 00:00:00 2001 From: pjotrp Date: Tue, 1 Mar 2016 08:55:10 +0000 Subject: setup: prepare for Guix runtime --- bin/genenetwork2 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/genenetwork2 b/bin/genenetwork2 index 00ee09bf..e5f04ee1 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -1,6 +1,9 @@ #! /bin/bash # -# This will run the server with default settings. +# This will run the GN2 server (with default settings if none supplied). +# +# Environment settings can be used to preconfigure as well as a +# settings.py file. # Absolute path to this script, e.g. /home/user/bin/foo.sh SCRIPT=$(readlink -f "$0") @@ -8,20 +11,29 @@ SCRIPT=$(readlink -f "$0") GN2_BASE_PATH=$(dirname $(dirname "$SCRIPT")) echo $GN2_BASE_PATH +# Handle setting parameter settings=$1 if [ -z $settings ]; then settings=$GN2_BASE_PATH/etc/default_settings.py ; fi -export PYTHONPATH=$GN2_BASE_PATH/wqflask:$PYTHONPATH +if [ ! -e $settings ]; then + echo "ERROR: can not load settings file $settings" + exit 1 +fi export WQFLASK_SETTINGS=$settings +# We may change this one: +export PYTHONPATH=$GN2_BASE_PATH/wqflask:$PYTHONPATH + +# TEMPDIR defaults to /tmp if nothing else if [ -z $TEMPDIR ]; then TEMPDIR="/tmp" fi -# start the redis server +# Start the redis server echo -n "dir $TEMPDIR dbfilename gn2.rdb " | redis-server - & +# Start the flask server running GN2 cd $GN2_BASE_PATH/wqflask echo "Starting with $settings" /usr/bin/env python runserver.py -- cgit v1.2.3