https://gitlab.synchro.net/main/sbbs/-/commit/e7109c87bc43f21636c5f981
Modified Files:
src/sbbs3/xtrn.cpp
Log Message:
When user hangs-up on external programs on *nix, try to terminate w/SIGTERMPreviously, when a user disconnected or ran out of time while running astdio-based external program on *nix, if the program was still running, we'dsend it a SIGHUP, wait up to 10 seconds for the process to terminate and ifit did not, terminate it (ungracefully) with SIGKILL. Since some programscatch SIGTERM (and not SIGHUP) to indicate a termination request, we now willfirst attempt a SIGHUP, wait up to 5 seconds for the process to terminate andif it does not, then send a SIGTERM and wait up to another 5 seconds for itto terminate and if it doesn't, then finally send it a SIGKILL (which cannotbe caught and always results in an ungraceful termination of the childprocess).This doesn't resolve any specific problem with any specific stdio-basedexternal program, but I was playing around with ESR's port of Adventure(
https://gitlab.com/esr/open-adventure) and a new auto-save/restore of gamestate and noticed that we weren't using SIGTERM for this situation, though weshould have. Most modern programs, if they catch SIGHUP at all, use it toindicate a refresh of configuration or data files, not a termination request(or indication that a user has "hung up"). So SIGTERM is more reasonable to beexpected to be caught and initiate the graceful termination of the childprogram that we're hoping for.
--- SBBSecho 3.15-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)