From a568b1b7a97c40607d998d035db99b444b74dd60 Mon Sep 17 00:00:00 2001 From: jenz Date: Sat, 6 Jan 2024 19:38:47 +0100 Subject: [PATCH] added socket close when exiting. added pkill to users pid to clear /dev/shm. added exit post program to kill with pkill again due to atexit handler not responding to signals from outside python --- AutismBotIngame/python/exit_handler.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 AutismBotIngame/python/exit_handler.py diff --git a/AutismBotIngame/python/exit_handler.py b/AutismBotIngame/python/exit_handler.py new file mode 100644 index 00000000..255ccef2 --- /dev/null +++ b/AutismBotIngame/python/exit_handler.py @@ -0,0 +1,9 @@ +#!/home/autismbot1/ze_runner/venv/bin/python3 + +if __name__ == '__main__': + import subprocess + #deleting POSIX shared memory objects, as long as one process has them open they exist. THis is to prevent /dev/shm from being full + #due to steam child processes. + #even with steam turned offline might there be chromium web browsers left over from steam who still hold processes open. + #only kind of potential issues from this is steam cloud being out of sync, which is really fucking irrelevant. + subprocess.getoutput([f"pkill -9 -u {whoami}"])