Hello,
I have a subprocess running named proc and need to send it a USR1 signal. To do that, I'm using proc.send_signal(signal.SIGUSR1). The problem is that it takes some time for the process to do what it does after receiving the signal and I need to wait until it finishes that before continuing the execution of my code. I am currently adding a time.sleep(0.5) line after sending the signal (it usually takes about half a second to finish), but it varies a little with each execution and therefore it does not always works as needed.
Is there a way to wait until the process finishes doing what it does after sending a signal to it?
Thank you very much in advance and please forgive my English.
Best regards,
Plinio
I have a subprocess running named proc and need to send it a USR1 signal. To do that, I'm using proc.send_signal(signal.SIGUSR1). The problem is that it takes some time for the process to do what it does after receiving the signal and I need to wait until it finishes that before continuing the execution of my code. I am currently adding a time.sleep(0.5) line after sending the signal (it usually takes about half a second to finish), but it varies a little with each execution and therefore it does not always works as needed.
Is there a way to wait until the process finishes doing what it does after sending a signal to it?
Thank you very much in advance and please forgive my English.
Best regards,
Plinio