[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Graphics in forked subprocess
From: |
Mike Miller |
Subject: |
Re: Graphics in forked subprocess |
Date: |
Sun, 19 May 2019 13:53:30 -0700 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sun, May 19, 2019 at 21:52:39 +0200, Pavel Hofman wrote:
> Thanks a lot for your help. I did use exec. But exec creates two child
> processes: A) octave which runs B)
> /usr/lib/x86_64-linux-gnu/octave/4.2.2/exec/x86_64-pc-linux-gnu/octave-gui.
> B) runs the actual script while PID of A) is returned by exec().
Are you sure the process IDs of A and B are different? In my testing
they are the same. The intent is for the process ID to remain the same.
> I need to
> have a way to stop the child process from my control script. I wanted to
> stop the child process by sending kill(pid) - for that I need pid of B) -
> sending kill to A) does not stop B). I have to be able to check B) has
> finished/died to restart if needed
Sure.
> That is why I skipped the exec call and sourced octave code directly after
> forking.
>
> Please what is the best practice for this kind of control? I know I can use
> a side channel, but I want to be able to kill the child reliably (kill -15
> ?) even if it gets stuck.
That sounds like a fine approach. Keep in mind there is at least one
known bug with ending an Octave process with SIGTERM in Octave 4.4 and
later versions.
https://savannah.gnu.org/bugs/?54444)
Feel free to ask for help or report bugs if you run into other problems
starting or controlling Octave subprocesses.
--
mike
signature.asc
Description: PGP signature