From 4f221621585e3fb6f68801ed8d19526a42c6b490 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 7 Jul 2021 09:08:20 +1000 Subject: VArious small sledjchisl things. Complain if we can't remove a stale PID file. Don't wait after ROBUST starts. Do web thing only if it's a plain "start everything". --- src/sledjchisl/sledjchisl.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 8ab41ab..0ea29a3 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -1029,6 +1029,11 @@ int checkSimIsRunning(char *sim) path = xmprintf("rm -f %s/caches/%s.pid", scRoot, sim); d("%s", path); i = system(path); + if (WIFEXITED(i)) + { + if (0 != WEXITSTATUS(i)) // No such pid. + E("Cannot remove stale PID file %s", path); + } } else d("checkSimIsRunning(%s) has PID %s, which is actually running.", sim, pid); @@ -7520,7 +7525,7 @@ T("ARGS - %i |%s| |%s|", currentMode, toys.optargs[0], target); free(c); waitTmuxText(d, "INITIALIZATION COMPLETE FOR ROBUST"); I("ROBUST is done starting up."); - la = waitLoadAverage(la, loadAverageInc / 3.0, simTimeOut / 3); +// la = waitLoadAverage(la, loadAverageInc / 3.0, simTimeOut / 3); free(d); } @@ -7755,6 +7760,7 @@ sims = -- Note these are .shini / tmux tab short names. } nextSim: number++; +//if (2 < number) break; } lua_pop(L, 1); // removes 'value'; keeps 'key' for next iteration } @@ -7767,9 +7773,11 @@ nextSim: } - if ((START == currentMode) && checkSimIsRunning("ROBUST")) + + if ((START == currentMode) && checkSimIsRunning("ROBUST") && (NULL == target)) { // Start up the web stuff. TODO - remove this once we handle the fcgi stuff ourselves. + T("Starting the web stuff."); char *d = xmprintf("%s.{left}", Ttab); char *c = xmprintf("cd %s/current/src;" " spawn-fcgi -n -u %s -s %s/sledjchisl.socket -M 0660 -G www-data -- " @@ -7779,6 +7787,8 @@ nextSim: free(c); free(d); } + else + T("NOT Starting the web stuff."); /* -- cgit v1.1