diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2014-01-30 16:44:48 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2014-01-30 16:44:48 +0000 |
commit | 2d056392e6806e075d55d5753c93a0fb18785c52 (patch) | |
tree | 7a1502e59d4f63ddc615b2cc0298c4368364f23f /yarns.webapp/900-implementations.yarn | |
parent | 31a380115a0f05d9709e016e349fbf91f1c20e2a (diff) | |
download | lorry-controller-2d056392e6806e075d55d5753c93a0fb18785c52.tar.gz |
Use fifo for synchronisatoin, rather that stat looprichardmaw/ephemeral-port
Diffstat (limited to 'yarns.webapp/900-implementations.yarn')
-rw-r--r-- | yarns.webapp/900-implementations.yarn | 8 |
1 files changed, 5 insertions, 3 deletions
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. |