M
Maksim Kasimov
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)
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)