From 55ba63d333253648ffd799f61838a51ccb491dca Mon Sep 17 00:00:00 2001 From: Robert Martin-Legene <robert@nic.ar> Date: Thu, 26 Jul 2018 18:31:57 -0300 Subject: [PATCH] Trying new flock method --- bin/start.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bin/start.sh b/bin/start.sh index 9a71f30..555f331 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -24,13 +24,13 @@ function startgeth $( accountlist ) \ $( miner ) \ --networkid $BFANETWORKID \ + --bootnodes "${bootnodes}" \ --rpc \ --rpcport $rpcport \ --rpcapi "eth,net,web3,admin,clique,miner" \ --port $netport \ --syncmode full \ --nousb \ - --bootnodes "${bootnodes}" \ --txpool.nolocals \ --txpool.accountslots 128 \ --txpool.globalslots 32768 \ @@ -74,13 +74,18 @@ function miner fi } + + # Start the miner. test -e "${BFANODEDIR}/geth.pid" || touch ${BFANODEDIR}/geth.pid -flock --nonblock --exclusive ${BFANODEDIR}/geth.pid startgeth 2>&1 | - ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log & -if [ -t 1 ] -then - echo Logging everything to ${BFANODEDIR}/log - echo Consider running: tail -n 1000 -F ${BFANODEDIR}/log -fi +( + flock --nonblock --exclusive 9 || exit 1 + startgeth 2>&1 | + ${BFAHOME}/bin/log.sh ${BFANODEDIR}/log & + if [ -t 1 ] + then + echo Logging everything to ${BFANODEDIR}/log + echo Consider running: tail -n 1000 -F ${BFANODEDIR}/log + fi +) 9>> ${$BFANODEDIR}/geth.pid -- GitLab