SIGTERM handling

Discussion in 'Python' started by Manlio Perillo, May 5, 2006.

  1. Hi.

    I have tried this script:

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


    msvcrt = cdll.LoadLibrary("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
    Manlio Perillo, May 5, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Teresa
    Replies:
    2
    Views:
    638
    Rob Thorpe
    Apr 6, 2004
  2. Jane Austine
    Replies:
    2
    Views:
    1,101
    Donn Cave
    Aug 16, 2003
  3. Zoran Bosnjak

    popen3,4 and SIGTERM

    Zoran Bosnjak, Oct 15, 2003, in forum: Python
    Replies:
    0
    Views:
    397
    Zoran Bosnjak
    Oct 15, 2003
  4. Andrew Athan
    Replies:
    0
    Views:
    402
    Andrew Athan
    Jan 6, 2004
  5. Andrew Athan
    Replies:
    0
    Views:
    456
    Andrew Athan
    Jan 6, 2004
Loading...

Share This Page