I do not know why the start node at start-up did not work. This is what I have done. I wrote a short bash script that checks if the node is running and start it if the node is not. Then added the cronjob to run every 20 minutes.
This is the body of check_running.sh
chia_pid=`pgrep -f chia_farmer`
if [[ $chia_pid -gt 1 ]]
then
echo "`date` Check Successful PID: $chia_pid"
else
echo "`date` Starting Farmer"
cd /usr/lib/chia-blockchain ; . ./activate ; chia start farmer
fi
do not forget to set the script as executable:
chmod u=xrw check_running.sh
Then in /hive/etc/crontab.root add the following:
# Check Chia node status
*/20 * * * * {/path/to/script}/check_running.sh >> /var/log/chia_checks.log
Assuming you have the path correct on your own script this will log the checks to /var/log/chia_checks.log. Once you have fully verified the whole system is working as intended we might consider removing the logging.
Update: changed the bash script because the if statement was reading the empty PID as non-zero
I also found that the corn job was running in the root environment so I added a symlink to the .chia directory. ln -s {/path/to/data}.chia /root/.chia