|
| 1 | +#!/bin/bash |
| 2 | +# |
| 3 | +# Copyright 2012 NAMD-EMAP-FGV |
| 4 | +# |
| 5 | +# This file is part of PyPLN. You can get more information at: http://pypln.org/. |
| 6 | +# |
| 7 | +# PyPLN is free software: you can redistribute it and/or modify |
| 8 | +# it under the terms of the GNU General Public License as published by |
| 9 | +# the Free Software Foundation, either version 3 of the License, or |
| 10 | +# (at your option) any later version. |
| 11 | +# |
| 12 | +# PyPLN is distributed in the hope that it will be useful, |
| 13 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | +# GNU General Public License for more details. |
| 16 | +# |
| 17 | +# You should have received a copy of the GNU General Public License |
| 18 | +# along with PyPLN. If not, see <http://www.gnu.org/licenses/>. |
| 19 | + |
| 20 | +SCRIPT_PATH=$(dirname $(readlink -f $0)) |
| 21 | +echo "$SCRIPT_PATH" |
| 22 | + |
| 23 | +# Adding the current directory to PYTHONPATH, the broker will be able to import |
| 24 | +# pypln.backend even if the package is not installed |
| 25 | +export PYTHONPATH="$SCRIPT_PATH:$PYTHONPATH" |
| 26 | + |
| 27 | +echo "+-------------------------------------------------------+" |
| 28 | +echo "| This script is intended for development only. |" |
| 29 | +echo "| Please do not use it to run a production environment. |" |
| 30 | +echo "+-------------------------------------------------------+" |
| 31 | + |
| 32 | +echo "Starting router..." |
| 33 | +"$SCRIPT_PATH/pypln/backend/router.py" & |
| 34 | +ROUTER_PID=$! |
| 35 | +echo "Router has PID $ROUTER_PID" |
| 36 | + |
| 37 | +echo "Starting pipeliner..." |
| 38 | +"$SCRIPT_PATH/pypln/backend/pipeliner.py" & |
| 39 | +PIPELINER_PID=$! |
| 40 | +echo "Pipeliner has PID $PIPELINER_PID" |
| 41 | + |
| 42 | +echo "Starting broker..." |
| 43 | +"$SCRIPT_PATH/pypln/backend/broker.py" & |
| 44 | +BROKER_PID=$! |
| 45 | +echo "Broker has PID $BROKER_PID" |
| 46 | + |
| 47 | +trap "kill 0; exit" SIGINT SIGTERM SIGKILL |
| 48 | + |
| 49 | +while : |
| 50 | +do |
| 51 | + sleep 1 |
| 52 | +done |
0 commit comments