From 3dafab3491e7b0edf4901f33a5f165c9aa2eb9a5 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Fri, 26 Jun 2015 15:21:47 +0200 Subject: util --- util/run_server | 10 ++++++---- util/wrapper.rb | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/util/run_server b/util/run_server index 651638a..b983425 100755 --- a/util/run_server +++ b/util/run_server @@ -1,8 +1,10 @@ #!/bin/bash -x -export LD_LIBRARY_PATH=/fast_scratch/simianer/lfpe/nanomsg-0.5-beta/lib -export PYTHONPATH=/fast_scratch/simianer/lfpe/python +export LD_LIBRARY_PATH=/fast_scratch/simianer/lfpe/lib/nanomsg-0.5-beta/lib:$LD_LIBRARY_PATH +export PYTHONPATH=/fast_scratch/simianer/lfpe/lib/python:$PYTHONPATH +export GEM_PATH=/fast_scratch/simianer/lfpe/lib/ruby/:$GEM_PATH UTIL=/fast_scratch/simianer/lfpe/lfpe/util -SESSION=/fast_scratch/simianer/lfpe/sessions/tiny_test -clear;$UTIL/kill;$UTIL/kill;$UTIL/kill;rm $SESSION/work/lockfile; cp $SESSION/data.json.original $SESSION/data.json; $UTIL/../server.rb $SESSION/conf.rb +SESSION=tiny_test +DIR=/fast_scratch/simianer/lfpe/sessions/$SESSION +clear;$UTIL/kill;$UTIL/kill;$UTIL/kill;rm $DIR/work/lockfile; cp $DIR/data.json.original $DIR/data.json; $UTIL/../server.rb $DIR/conf.rb diff --git a/util/wrapper.rb b/util/wrapper.rb index 8445f0f..d18dd39 100755 --- a/util/wrapper.rb +++ b/util/wrapper.rb @@ -36,12 +36,14 @@ else end pin, pout, perr = Open3.popen3(cmd) while true - inp = sock.recv.strip+"\n" + inp = sock.recv.strip break if !inp||inp=="shutdown" - pin.write inp + pin.write inp+"\n" sock.send pout.gets.strip end +STDERR.write "[wrapper] shutting down\n" pin.close; pout.close; perr.close sock.send "off" +exit 0 -- cgit v1.2.3