Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

He who hoots with owls by night cannot soar with eagles by day.


dovenet / Synchronet Programming / src/sbbs3/xtrn.cpp

SubjectAuthor
o src/sbbs3/xtrn.cppRob Swindell

1
src/sbbs3/xtrn.cpp

<6340D57B.46024.syncprog@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=35&group=DOVE-Net.Synchronet_Programming#35

  copy link   Newsgroups: DOVE-Net.Synchronet_Programming
From: rob.swindell@VERT (Rob Swindell)
To: Git commit to main/sbbs/master
Subject: src/sbbs3/xtrn.cpp
Message-ID: <6340D57B.46024.syncprog@vert.synchro.net>
Date: Fri, 7 Oct 2022 11:42:19 -0700
X-Comment-To: Git commit to main/sbbs/master
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Programming
X-FTN-PID: Synchronet 3.20a-Linux new_config_format/7ce2d50c6 Sep 22 2022 GCC 8.3.0
X-FTN-MSGID: 46024.syncprog@1:103/705 27a6bf43
X-FTN-CHRS: CP437 2
WhenImported: 20221007184219-0700 c1e0
WhenExported: 20221007211858-0700 c1e0
ExportedFrom: VERT syncprog 46024
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Rob Swindell - Fri, 7 Oct 2022 18:42 UTC

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/SIGTERM

Previously, when a user disconnected or ran out of time while running a
stdio-based external program on *nix, if the program was still running, we'd
send it a SIGHUP, wait up to 10 seconds for the process to terminate and if
it did not, terminate it (ungracefully) with SIGKILL. Since some programs
catch SIGTERM (and not SIGHUP) to indicate a termination request, we now will
first attempt a SIGHUP, wait up to 5 seconds for the process to terminate and
if it does not, then send a SIGTERM and wait up to another 5 seconds for it
to terminate and if it doesn't, then finally send it a SIGKILL (which cannot
be caught and always results in an ungraceful termination of the child
process).

This doesn't resolve any specific problem with any specific stdio-based
external 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 game
state and noticed that we weren't using SIGTERM for this situation, though we
should have. Most modern programs, if they catch SIGHUP at all, use it to
indicate 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 be
expected to be caught and initiate the graceful termination of the child
program that we're hoping for.

---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net


dovenet / Synchronet Programming / src/sbbs3/xtrn.cpp

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor