I need to use Max to start up two unix-based programs upon loadbang. Both of these are audio server type programs, and remain running for as long as you need the audio and OSC to stream, instead of being programs that just execute a few commands and then release you back to the prompt.
So I already need two shell objects, if each one is to "house" one of the two programs for the entire life of the patch. This works fine for this purpose, but ideally, I would like the two programs to "outlive" the patch if something goes wrong and I have to close Max. This is more a safety precaution than anything else.
As I understand it, if I close the patch or delete/reinstantiate a shell object, the running process in it dies. Is this true?
If so, I suppose the best solution would be for me to use [shell] to boot up two Terminal windows (I’m on a Mac) and somehow send them each the instructions to start their respective program. This way, the stability of the programs is in Terminal’s hands rather than the [shell] object within the patch.
Is this possible/reasonable?
You could also look into the nohup command, e.g. "nohup
The downside is that you’d then have to kill those processes manually although there are way to make that a little more graceful.
You can also just use the launchbrowser message to max:
max launchbrowser file://localhost/path/to/program
in a messagebox. Terminal window does open, but there’s always apple-H.
I didn’t know about either of these mechanisms and they both work great for my purposes.
C74 RSS Feed | © Copyright Cycling '74