stratum: skip screen instances if there is no .conf

This commit is contained in:
Tanguy Pruvot 2016-11-29 04:51:13 +01:00
parent 11c8d5b767
commit ff136d53af
3 changed files with 12 additions and 9 deletions

View file

@ -17,7 +17,7 @@ screen -dmS loop2 $WEB_DIR/loop2.sh
screen -dmS blocks $WEB_DIR/blocks.sh
screen -dmS debug tail -f $LOG_DIR/debug.log
# Stratum ports
# Stratum instances (skipped/exit if no .conf)
screen -dmS c11 $STRATUM_DIR/run.sh c11
screen -dmS x11 $STRATUM_DIR/run.sh x11

View file

@ -4,7 +4,7 @@ ulimit -n 10240
ulimit -u 10240
cd /var/stratum
while true; do
while [ -e config/${1}.conf ]; do
gzip -f config/${1}.log
./stratum config/$1
sleep 1

View file

@ -312,14 +312,17 @@ void *monitor_thread(void *p)
exit(1);
}
if(g_max_shares > 0 && g_shares_counter > g_max_shares) {
g_exiting = true;
stratumlog("%s need a restart, exiting...\n", g_current_algo->name);
exit(1);
if(g_max_shares && g_shares_counter) {
if((g_shares_counter % 5000u) == 0) {
stratumlog("%s %luK shares...\n", g_current_algo->name, (g_shares_counter/10000u));
}
if((g_shares_counter % 10000u) == 0) {
stratumlog("%s %luK shares...\n", g_current_algo->name, (unsigned long) (g_shares_counter/10000u));
if(g_shares_counter > g_max_shares) {
g_exiting = true;
stratumlog("%s need a restart (%lu shares), exiting...\n", g_current_algo->name, g_max_shares);
exit(1);
}
}
}
}