Linux Web App - How to catch the kill signal

As Timothy noted, SIGKILL can’t be caught by a process. SIGTERM can be caught by processes with a signal handler, but signal handlers have some very stringent restrictions on what they can and can’t do. Specifically, they’re limited to setting global variables or calling async signal safe functions (see CERT’s SIG30-C for a much more in-depth explanation).

Any code using the Xojo runtime is not async signal safe, so a Xojo function cannot be set as a signal handler. Your best bet is probably to use a plugin for now and sign on to <https://xojo.com/issue/2332>.