Python Forum
Subprocess.send_signal, wait until completion
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subprocess.send_signal, wait until completion
#1
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
Reply


Messages In This Thread
Subprocess.send_signal, wait until completion - by plinio - Jun-27-2018, 10:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Wait til a date and time KatManDEW 2 1,495 Mar-11-2022, 08:05 PM
Last Post: KatManDEW
  wait for the first of these events Skaperen 4 2,077 Mar-07-2022, 08:46 PM
Last Post: Gribouillis
  how to do a two-way wait Skaperen 2 1,324 Mar-04-2022, 02:31 AM
Last Post: Skaperen
  Run an app in a standalone terminal and wait until it's closed glestwid 2 2,612 Aug-30-2020, 08:14 AM
Last Post: glestwid
  python os.popen is not working for wait method elenaflorence87 0 2,054 Jul-22-2020, 12:56 PM
Last Post: elenaflorence87
  Wait for command within a process bRitch022 1 3,347 Jul-15-2020, 07:03 PM
Last Post: bRitch022
  Multiprocessing Module Running An Infinite Child Process Even After Completion hsikora 0 3,959 Dec-19-2018, 08:01 AM
Last Post: hsikora
  How do you wait for a daemon to reach a certain state with subprocess.popen()? phalse 3 7,988 Jul-08-2017, 12:32 PM
Last Post: DeaD_EyE
  just a trial. Please wait 5 minutes before deleting this thread sylas 2 3,505 Jun-06-2017, 03:34 PM
Last Post: snippsat
  Code completion for namedtupe-based object in PyCharm volcano63 4 6,058 May-01-2017, 09:18 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020