signal.SIGHUP handling

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top