[HN Gopher] Beyond Ctrl-C: The dark corners of Unix signal handling
       ___________________________________________________________________
        
       Beyond Ctrl-C: The dark corners of Unix signal handling
        
       Author : PuercoPop
       Score  : 9 points
       Date   : 2024-09-04 19:24 UTC (3 days ago)
        
 (HTM) web link (sunshowers.io)
 (TXT) w3m dump (sunshowers.io)
        
       | chrsig wrote:
       | My favorite signal surprise was running nginx and/or httpd in the
       | foreground and wondering why on earth it quit whenver i resized
       | the window.
       | 
       | Turns out, they use SIGWINCH (which is sent on WINdow CHange) for
       | graceful shutdown.
       | 
       | It's a silly, silly problem.
        
       | efxhoy wrote:
       | I recently wrote a little data transfer service in python that
       | runs in ECS. When developing it locally it was easy to handle
       | SIGINT: try write a batch, except KeyboardInterrupt, if caught
       | mark the transfer as incomplete and finally commit the change and
       | shut down.
       | 
       | But there's no exception in python to catch for a SIGTERM, which
       | is what ECS and other service mangers send when it's time to shut
       | down. So I had to add a signal handler. Would have been neat if
       | SIGTERM could be caught like SIGINT with a "native" exception.
        
       ___________________________________________________________________
       (page generated 2024-09-07 23:00 UTC)