Hi,
If I launch Pd from a terminal (without "&"), when the terminal is closed Pd dies, which is fine for me.
However, if from the terminal I launch Pd with the "-nogui" option, then it survives and keeps running even if the terminal is closed.
Is there a way to launch Pd from a script with -nogui in such a way that when the terminal in which it was launched is closed, the Pd process is also killed?
Thanks m.
2011/6/17 Matteo Sisti Sette matteosistisette@gmail.com:
Is there a way to launch Pd from a script with -nogui in such a way that when the terminal in which it was launched is closed, the Pd process is also killed?
That's what already happen with all jobs running on one particular terminal. If you open a text editor from terminal, you can't close that terminal until you save your text.. etc..
On 06/17/2011 04:58 PM, Bernardo Barros wrote:
That's what already happen with all jobs running on one particular terminal. If you open a text editor from terminal, you can't close that terminal until you save your text.. etc..
But strangely, that doesn't happen with the "puredata" process when launched with -nogui.
Try it. Write in a terminal: puredata -nogui
Close the terminal. You don't get the usual dialog asking for confirmation. After closing the terminal open the system monitor, you will see the "puredata" process is still there.
When you launch Pd without -gui, then it's like you say.
On Fri, 17 Jun 2011, Bernardo Barros wrote:
2011/6/17 Matteo Sisti Sette matteosistisette@gmail.com:
Is there a way to launch Pd from a script with -nogui in such a way that when the terminal in which it was launched is closed, the Pd process is also killed?
That's what already happen with all jobs running on one particular terminal. If you open a text editor from terminal, you can't close that terminal until you save your text.. etc..
Note that when you press Ctrl+z in the Terminal and then say :
bg; exit
it closes the terminal while keeping all the same tasks running.
same when launching an app from a Terminal by saying :
pd whatever.pd & exit
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On Fri, 2011-06-17 at 16:39 +0200, Matteo Sisti Sette wrote:
Hi,
If I launch Pd from a terminal (without "&"), when the terminal is closed Pd dies, which is fine for me.
However, if from the terminal I launch Pd with the "-nogui" option, then it survives and keeps running even if the terminal is closed.
Is there a way to launch Pd from a script with -nogui in such a way that when the terminal in which it was launched is closed, the Pd process is also killed?
Hm.. don't know why it shows this behaviour with -nogui. Perhaps the pd process is a child process of the pd-gui process, and probably pd-gui immediately stops running after launch when -nogui is set, thus pd is not a child process of the terminal and won't shutdown when the terminal is killed? just some thoughts....
Anyway, you still could send the 'pd -nogui' process to the background and then later kill it by its process ID:
$ pd -nogui & $ pdpid=$?
and later:
$ kill $pdpid
Roman
On 06/17/2011 08:30 PM, Roman Haefeli wrote:
Hm.. don't know why it shows this behaviour with -nogui. Perhaps the pd process is a child process of the pd-gui process, and probably pd-gui immediately stops running after launch when -nogui is set, thus pd is not a child process of the terminal and won't shutdown when the terminal is killed? just some thoughts....
Same thoughts here :)
Anyway, you still could send the 'pd -nogui' process to the background and then later kill it by its process ID:
$ pd -nogui& $ pdpid=$?
and later:
$ kill $pdpid
But I would have to do it manually, right? Since it's not me who have to use the patch, I'm looking for a way to ensure that one cannot forget to do something and end up with half a dozen puredata processes running without being aware (i.e. without any open window), but at the same time I do want to launch this particular Pd instance with nogui.
Is there a way to use that approach (in a shell script or something) in such a way that I can ensure that the killing is done when the terminal is closed?
(by the way I need something that would work on Mac OS, but usually as far as shell scripts and the like are concerned, simple stuff that works in linux also works in Mac OS with little changes...)