diff options
author | onefang | 2021-08-11 19:32:33 +1000 |
---|---|---|
committer | onefang | 2021-08-11 19:32:33 +1000 |
commit | e657b09bf9998c575138d4fb4a6ebf5463e3aebb (patch) | |
tree | 8dbebdd57ddc576bdba187856a6b8db025a5bb52 | |
parent | More betterer output. (diff) | |
download | opensim-SC-e657b09bf9998c575138d4fb4a6ebf5463e3aebb.zip opensim-SC-e657b09bf9998c575138d4fb4a6ebf5463e3aebb.tar.gz opensim-SC-e657b09bf9998c575138d4fb4a6ebf5463e3aebb.tar.bz2 opensim-SC-e657b09bf9998c575138d4fb4a6ebf5463e3aebb.tar.xz |
More shutdown clean ups.
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index f04d5ff..b946f95 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c | |||
@@ -7306,6 +7306,17 @@ static void cleanup(void) | |||
7306 | // TODO - not sure why, but this gets called twice on quitting sometimes. | 7306 | // TODO - not sure why, but this gets called twice on quitting sometimes. |
7307 | C("Caught signal, or quitting, cleaning up."); | 7307 | C("Caught signal, or quitting, cleaning up."); |
7308 | 7308 | ||
7309 | char *cmd = xmprintf("%s/sledjchisl.socket", scRun); | ||
7310 | |||
7311 | if (qfile_exist(cmd)) | ||
7312 | { | ||
7313 | free(cmd); | ||
7314 | cmd = xmprintf("rm %s/sledjchisl.socket", scRun); | ||
7315 | if (!WIFEXITED(system(cmd))) | ||
7316 | E("rm command failed!"); | ||
7317 | free(cmd); | ||
7318 | } | ||
7319 | |||
7309 | if (accountPages) | 7320 | if (accountPages) |
7310 | { | 7321 | { |
7311 | qhashtbl_obj_t obj; | 7322 | qhashtbl_obj_t obj; |
@@ -7367,6 +7378,18 @@ static void cleanup(void) | |||
7367 | } | 7378 | } |
7368 | if (configs) configs->free(configs); | 7379 | if (configs) configs->free(configs); |
7369 | configs = NULL; | 7380 | configs = NULL; |
7381 | |||
7382 | /* tmux should clean up it's own socket. Doesn't seem to care anyway. | ||
7383 | cmd = xmprintf("%s/%s", scRun, Tsocket); | ||
7384 | if (qfile_exist(cmd)) | ||
7385 | { | ||
7386 | free(cmd); | ||
7387 | cmd = xmprintf("rm %s/%s", scRun, Tsocket); | ||
7388 | if (!WIFEXITED(system(cmd))) | ||
7389 | E("rm command failed!"); | ||
7390 | free(cmd); | ||
7391 | } | ||
7392 | */ | ||
7370 | } | 7393 | } |
7371 | 7394 | ||
7372 | 7395 | ||
@@ -7902,6 +7925,17 @@ jit library is loaded or the JIT compiler will not be activated. | |||
7902 | { | 7925 | { |
7903 | // Stop all the sims. | 7926 | // Stop all the sims. |
7904 | forEachSim(NULL, stopSims, NULL); | 7927 | forEachSim(NULL, stopSims, NULL); |
7928 | |||
7929 | if (checkSimIsRunning("ROBUST")) | ||
7930 | { | ||
7931 | sendTmuxCmd("@0.%0", "quit"); | ||
7932 | while (checkSimIsRunning("ROBUST")) | ||
7933 | usleep(100000); | ||
7934 | usleep(10000); | ||
7935 | sendTmuxCmd("@0.%0", "exit"); | ||
7936 | I("ROBUST has stopped in tmux ID @0.%%0."); | ||
7937 | } | ||
7938 | |||
7905 | I("Closing all the other windows."); | 7939 | I("Closing all the other windows."); |
7906 | // First figure out what panes and windows are left. | 7940 | // First figure out what panes and windows are left. |
7907 | snprintf(toybuf, sizeof(toybuf), "echo 'IDs={' >%s/IDs_ALL.lua", scTemp); | 7941 | snprintf(toybuf, sizeof(toybuf), "echo 'IDs={' >%s/IDs_ALL.lua", scTemp); |
@@ -7912,6 +7946,11 @@ jit library is loaded or the JIT compiler will not be activated. | |||
7912 | snprintf(toybuf, sizeof(toybuf), "%s/IDs_ALL.lua", scTemp); | 7946 | snprintf(toybuf, sizeof(toybuf), "%s/IDs_ALL.lua", scTemp); |
7913 | qtreetbl_t *IDs = Lua2tree(toybuf, "IDs"); | 7947 | qtreetbl_t *IDs = Lua2tree(toybuf, "IDs"); |
7914 | 7948 | ||
7949 | char *c = xmprintf("rm -fr %s/*", scTemp); | ||
7950 | if (!WIFEXITED(system(c))) | ||
7951 | E("rm command failed! %s", c); | ||
7952 | free(c); | ||
7953 | |||
7915 | qtreetbl_obj_t obj0; | 7954 | qtreetbl_obj_t obj0; |
7916 | memset((void*)&obj0, 0, sizeof(obj0)); | 7955 | memset((void*)&obj0, 0, sizeof(obj0)); |
7917 | IDs->lock(IDs); | 7956 | IDs->lock(IDs); |
@@ -7925,10 +7964,6 @@ jit library is loaded or the JIT compiler will not be activated. | |||
7925 | IDs->unlock(IDs); | 7964 | IDs->unlock(IDs); |
7926 | freeLuaTree(IDs); | 7965 | freeLuaTree(IDs); |
7927 | 7966 | ||
7928 | char *c = xmprintf("rm -fr %s/*", scTemp); | ||
7929 | if (!WIFEXITED(system(c))) | ||
7930 | E("rm command failed! %s", c); | ||
7931 | free(c); | ||
7932 | } | 7967 | } |
7933 | else if (START == currentMode) | 7968 | else if (START == currentMode) |
7934 | { | 7969 | { |