2013-06-08-0843Z


That last script modification didn't work; the default TERM signal of kill has apparently no effect on the bitcoin daemon. Changed it to this:

#!/bin/bash
i=0;k=0
while true; do
 if [ "$(pidof bitcoind)" ]; then
  sleep 60  # check again after a minute
 else
  ~/bin/bitcoind &
  i=0;k=0
  sleep 60  # check again after a minute
 fi
 i=$((i+1))
 if [ $i -gt $((60*12)) ]; then  # restart after 12 hours
  flag=INT  # like control-C, since TERM doesn't seem to accomplish anything
  if [ $k -gt 10 ]; then flag=KILL; fi
  kill -s $flag $(pidof bitcoind)
  k=$((k+1))
 fi
done

Back to blog or home page

last updated 2013-06-08 04:44:34. served from tektonic.jcomeau.com