From 8046c5b81a1cf9025c9ba908429093086aa65498 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 17 Mar 2020 20:55:21 +1000 Subject: Move the tmux check until after we have loaded the config and paths. --- src/sledjchisl/sledjchisl.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 17a1ae8..800a224 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -4345,25 +4345,6 @@ void sledjchisl_main(void) if (!S_ISCHR(statbuf.st_mode)) isWeb = TRUE; } - if (!isWeb) - { - I("Outputting to a terminal, not a web server."); - // Check if we are already running inside the proper tmux server. - char *eTMUX = getenv("TMUX"); - memset(toybuf, 0, sizeof(toybuf)); - snprintf(toybuf, sizeof(toybuf), "%s/%s", scRoot, Tsocket); - if (((eTMUX) && (0 == strncmp(toybuf, eTMUX, strlen(toybuf))))) - { - I("Running inside the proper tmux server."); - isTmux = TRUE; - } - else - I("Not running inside the proper tmux server, starting it."); - I("libfcgi version: %s", FCGI_VERSION); - I("Lua version: %s", LUA_RELEASE); - I("LuaJIT version: %s", LUAJIT_VERSION); - I("MariaDB / MySQL client version: %s", mysql_get_client_info()); - } // Print our user name and groups. struct passwd *pw; @@ -4518,6 +4499,22 @@ jit library is loaded or the JIT compiler will not be activated. scLog = xmprintf("%s%s/var/log", slsh, scRoot); } + if (!isWeb) + { + I("Outputting to a terminal, not a web server."); + // Check if we are already running inside the proper tmux server. + char *eTMUX = getenv("TMUX"); + memset(toybuf, 0, sizeof(toybuf)); + snprintf(toybuf, sizeof(toybuf), "%s/%s", scRun, Tsocket); + if (((eTMUX) && (0 == strncmp(toybuf, eTMUX, strlen(toybuf))))) + { + I("Running inside the proper tmux server. %s", eTMUX); + isTmux = TRUE; + } + else + I("Not running inside the proper tmux server, starting it. %s == %s", eTMUX, toybuf); + } + if (isTmux || isWeb) { char *d; -- cgit v1.1