I can't find a watchdog, no sign of cgminer getting restarted.
I've got my own watchdog running now.
Other than stopping, possibly when trying to start when servers aren't responding quickly enough, your image has worked ok.
I had a quick go at putting your cgminer in minera. It didn't seem to like the mix of command line and json.conf. I can't be bothered to delve into minera...
The watchdog is programmed into cgminer, it is not external:
/* Makes sure the hashmeter keeps going even if mining threads stall, updates
* the screen at regular intervals, and restarts threads if they appear to have
* died. */
#define WATCHDOG_INTERVAL 2
#define WATCHDOG_SICK_TIME 120
#define WATCHDOG_DEAD_TIME 600
#define WATCHDOG_SICK_COUNT (WATCHDOG_SICK_TIME/WATCHDOG_INTERVAL)
#define WATCHDOG_DEAD_COUNT (WATCHDOG_DEAD_TIME/WATCHDOG_INTERVAL)
static void *watchdog_thread(void __maybe_unused *userdata)
{
const unsigned int interval = WATCHDOG_INTERVAL;
struct timeval zero_tv;
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
RenameThread("watchdog");
set_lowprio();
memset(&zero_tv, 0, sizeof(struct timeval));
cgtime(&rotate_tv);
while (1) {
int i;
struct timeval now;
sleep(interval);
discard_stale();
hashmeter(-1, &zero_tv, 0);
The big problem was that cgminer exits if it can't connect to pools. It does seem to keep running if it starts properly. I've got a bash script that checks for the right number of ./cgminer processes every 3 minutes now. Too many, it kills them all, not enough, it invokes run.sh. I had some gridseed rigs where they sometimes started duplicate copies of cpuminer, which doesn't work very well. Your firmware hasn't had that problem, but I've left it in.
edit index.php to change run.sh to check.sh
check.sh, stick it in /var/www
#!/bin/bash
while true
do
MC=$(ps -ef | grep -v grep | grep -c "./cgminer -o stratum+tcp" )
# echo $MC
if [ $MC -lt 2 ]; then
sudo ./run.sh
else
if [ $MC -gt 2 ]; then
# echo too many
sudo /usr/bin/killall -s9 cgminer
fi
fi
sleep 180
done