summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-01-30 16:44:48 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2014-01-30 16:44:48 +0000
commit2d056392e6806e075d55d5753c93a0fb18785c52 (patch)
tree7a1502e59d4f63ddc615b2cc0298c4368364f23f
parent31a380115a0f05d9709e016e349fbf91f1c20e2a (diff)
downloadlorry-controller-richardmaw/ephemeral-port.tar.gz
Use fifo for synchronisatoin, rather that stat looprichardmaw/ephemeral-port
-rwxr-xr-xcheck2
-rw-r--r--yarns.webapp/900-implementations.yarn8
2 files changed, 6 insertions, 4 deletions
diff --git a/check b/check
index 70aa608..a82754e 100755
--- a/check
+++ b/check
@@ -8,6 +8,6 @@ set -eu
# a system with the necessary dependencies installed properly. (BR-13 also
# doesn't have a working sqlite3 Python binding, and that's not so easy to
# fix without a fixed system deployed.)
-export PYTHONPATH="/home/root/new-lorry-controller/bottle:/home/root/new-lorry-controller/flup"
+export PYTHONPATH="/home/richardmaw/workspace/baserock/src/bottle:/home/richardmaw/workspace/baserock/src/flup"
yarn -s yarns.webapp/yarn.sh yarns.webapp/*.yarn --env PYTHONPATH="$PYTHONPATH" "$@"
diff --git a/yarns.webapp/900-implementations.yarn b/yarns.webapp/900-implementations.yarn
index 19d4cfc..9310f6e 100644
--- a/yarns.webapp/900-implementations.yarn
+++ b/yarns.webapp/900-implementations.yarn
@@ -24,6 +24,9 @@ but the shell doesn't wait for it to terminate. This way, WEBAPP will
be running until it crashes or is explicitly killed.
IMPLEMENTS GIVEN a running WEBAPP
+
+ rm -f "$DATADIR/webapp.port"
+ mkfifo "$DATADIR/webapp.port"
start-stop-daemon -S -x "$SRCDIR/lorry-controller-webapp" \
-b -p "$DATADIR/webapp.pid" -m --verbose \
-- \
@@ -33,10 +36,9 @@ be running until it crashes or is explicitly killed.
--debug-host 127.0.0.1 \
--debug-port-file "$DATADIR/webapp.port"
- while [ ! -e "$DATADIR/webapp.port" ]; do
- sleep 1
- done
port=$(cat "$DATADIR/webapp.port")
+ rm -f "$DATADIR/webapp.port"
+ echo "$port" >"$DATADIR/webapp.port"
# Wait for the WEBAPP to actually be ready, i.e., that it's
# listening on its assigned port.