signal.SIGHUP handling

Maksim Kasimov maksim.kasimov at gmail.com
Fri Sep 9 06:58:57 EDT 2005


hi, please help to find out where is the problem:

i'm trying to hadle signal.SIGHUP (in unix prompt: kill -HUP <pid>)

first of all, i'm trying to do:
signal.signal(signal.SIGHUP, signal.SIG_IGN)

- it works fine (signal ignored)


but if use my handler, than it raises "Interrupted system call":

# all i need to do it is reopen log-file.
# It was opened at the time of pragramm start
def myHandler(signum, frame):
     sys.stdout = sys.stderr = open("mylog.log", "a+")

signal.signal(signal.SIGHUP, myHandler)



-- 
Best regards,
Maksim Kasimov
mailto: maksim.kasimov at gmail.com



More information about the Python-list mailing list