Skip to content
Snippets Groups Projects
Commit 3b3f98a4 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Starting monitor from start.sh. Cron.sh now only calls start.sh

parent 41011091
No related branches found
No related tags found
No related merge requests found
......@@ -8,13 +8,4 @@ exec < /dev/null > bfa-cron-output.log 2>&1
# Go to script bin, 'cause we expect to find $BFAHOME/bin/env there
cd `dirname $0`
source ./env
(
./start.sh &
# Yes, we wait 60 seconds after starting the server.
# If you don't want to wait, kill the sleep.. the || true
# will capture the ERR trap.
while sleep 60 || true
do
./monitor.sh
done &
)
./start.sh
......@@ -163,6 +163,7 @@ function usersetup
info Adding to automatically source \~bfa/bfa/bin/env via .bashrc
echo 'source ~/bfa/bin/env' >> .bashrc
fi
mkdir ~bfa/bfa/network
}
function cronit
......
......@@ -80,6 +80,25 @@ function startbootnode
) 9>> $pidfile
}
function startmonitor
{
local pidfile=${BFANETWORKDIR}/monitor.pid
(
flock --nonblock --exclusive 9 || (
echo "A monitor is already running."
false
) || exit
sleep 15
while :
do
monitor.sh &
echo $! > $pidfile
wait
sleep 60
done &
) 9>> $pidfile
}
function startgeth
{
# Start the node.
......@@ -121,3 +140,4 @@ function startgeth
startgeth
startbootnode
startmonitor
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment