From 2ed54a3817608bcf372b091efc9cb76a65150d33 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 27 Aug 2021 03:46:06 +1000 Subject: Configure the base port number for sim autogenerated ports. --- src/.sledjChisl.conf.lua | 1 + src/sledjchisl/sledjchisl.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/.sledjChisl.conf.lua b/src/.sledjChisl.conf.lua index cede4e4..e44886b 100644 --- a/src/.sledjChisl.conf.lua +++ b/src/.sledjChisl.conf.lua @@ -16,6 +16,7 @@ config = ["Tconsole"] = "SledjChisl"; ["Tsocket"] = "opensim-tmux.socket"; ["Ttab"] = "SC"; + ["startPort"] = 8002; ["loadAverageInc"] = 0.7; ["simTimeOut"] = 45; -- seconds ["bulkSims"] = 0; -- 0 means figure it out from number of CPUs. diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 6298760..fc0857a 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -521,6 +521,7 @@ char *Tconsole = "SledjChisl"; char *Tsocket = "opensim-tmux.socket"; char *Ttab = "SC"; char *Tcmd = "tmux -S"; +int startPort = 8002; char *backupIARsim = "Sandbox"; char *rSync = ""; int rSyncPort = 0; @@ -1847,8 +1848,8 @@ void prepSims(simData *simd, char *sim, char *type, int count, int window, int p shellMe("echo '}\nreturn IDs' >>%s/IDs_%d.lua", scTemp, window); findWindow(simd, sim, type, count, window, panes, pane); - simd->portH = 8004 + count * 2; - simd->portU = 8005 + count * 2; + simd->portH = startPort + 2 + count * 2; + simd->portU = startPort + 3 + count * 2; cmd = xmprintf("rm -fr %s/sim%d; mkdir -p %s/sim%d; sed -E" " -e 's@\\[Region\\]@" " paneID = \"\\%s\"\\n" @@ -8109,6 +8110,7 @@ Other possibilities - if ((tmp = configs->getstr(configs, "Tconsole", false)) != NULL) {Tconsole = tmp; V("Setting Tconsole = %s", Tconsole);} if ((tmp = configs->getstr(configs, "Tsocket", false)) != NULL) {Tsocket = tmp; V("Setting Tsocket = %s", Tsocket);} if ((tmp = configs->getstr(configs, "Ttab", false)) != NULL) {Ttab = tmp; V("Setting Ttab = %s", Ttab);} + if ((vd = configs->get (configs, "startPort", NULL, false)) != NULL) {startPort = (int) *((float *) vd); V("Setting startPort = %d", startPort);} if ((tmp = configs->getstr(configs, "backupIARsim", false)) != NULL) {backupIARsim = tmp; V("Setting backupIARsim = %s", backupIARsim);} if ((tmp = configs->getstr(configs, "rsync", false)) != NULL) {rSync = tmp; V("Setting rsync = %s", rSync);} if ((vd = configs->getstr(configs, "rsyncPort", false)) != NULL) {rSyncPort = (int) *((float *) vd); V("Setting rsyncPort = %s", rSyncPort);} -- cgit v1.1