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. Advertisements

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:
    745
    Rob Thorpe
    Apr 6, 2004
  2. Jane Austine
    Replies:
    2
    Views:
    1,432
    Donn Cave
    Aug 16, 2003
  3. Zoran Bosnjak

    popen3,4 and SIGTERM

    Zoran Bosnjak, Oct 15, 2003, in forum: Python
    Replies:
    0
    Views:
    550
    Zoran Bosnjak
    Oct 15, 2003
  4. Andrew Athan
    Replies:
    0
    Views:
    517
    Andrew Athan
    Jan 6, 2004
  5. Henry Law
    Replies:
    6
    Views:
    2,125
    Default User
    Sep 1, 2006
  6. Replies:
    2
    Views:
    701
  7. Francois Grieu

    Acting on SIGTERM signal under C99

    Francois Grieu, Sep 3, 2010, in forum: C Programming
    Replies:
    5
    Views:
    1,081
    Francois Grieu
    Sep 5, 2010
  8. Luca Boero
    Replies:
    2
    Views:
    319
    Arne Juul
    Feb 22, 2008
Loading...