Hey all, iv been having some issues with my Bitcoind server crashing due to running out of RAM. Obvious solution would be to just get more RAM, but currently cant afford that for at least a few weeks. Does anyone know of a wrapper that would automatically restart bitcoind once it detects a crash? Or maybe a tutorial/resource that would show me how to write up a quick script that would accomplish this? Major PITA to manually restart it each time.
also this is in linux.
*edit* Heres the solution I came up with. Fairly simple bash script that checks the server every 10 minutes.
#!/bin/bash
function checkServer {
local CHECK=$(pgrep bitcoind)
if [[ -z "$CHECK" ]]
then
echo 0
else
echo 1
fi
}
while sleep 600; do
if [ `checkServer` == 0 ]
then
echo Restarting Server
bitcoind -daemon
else
echo All is well
fi
done