aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorpjotrp2016-03-01 08:55:10 +0000
committerPjotr Prins2016-04-20 09:59:30 +0000
commit2fd8e09c3de9ee539e47bdb416a4c0df89ff15ab (patch)
treeb7684c3301343731da989c6a82b4cc51a4f20d68 /bin
parent6cf118eb55453d0ca041cf139bae4839ceb0286a (diff)
downloadgenenetwork2-2fd8e09c3de9ee539e47bdb416a4c0df89ff15ab.tar.gz
setup: prepare for Guix runtime
Diffstat (limited to 'bin')
-rwxr-xr-xbin/genenetwork218
1 files changed, 15 insertions, 3 deletions
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