SIGTERM handling

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Manlio Perillo

    #1

    SIGTERM handling

    Hi.

    I have tried this script:

    from ctypes import cdll, c_int
    from signal import SIGTERM, SIGINT
    from time import sleep


    msvcrt = cdll.LoadLibrar y("MSVCR71") # is this the lib to use?
    sig = c_int(SIGTERM)
    raise_ = getattr(msvcrt, "raise")
    raise_(sig)
    sleep(10)


    The problem is that SIGTERM causes the program to exit (without calling
    atexit registered functions).

    Why?
    In the MSDN documentations it is written that SIGTERM is by default
    ignored and in the Python documentation for signal module it is written
    that there should be no handler for SIGTERM.



    Thanks Manlio Perillo
Working...