|
From: Edward D. <di...@um...> - 2012-04-10 18:27:31
|
I do not know anything about how NSM kills applications at the end of a session so I can only offer general comments. I see your script just brings linuxsampler to the foreground (with fg command) which do not see would be connected with killing linuxsampler, unless NSM sent a ^C the script I see you save the process ID (LSPID), maybe NSM wants processes to return the processID so it can kill the process at the end. If so you could have your script return the LSPID by putting "echo $LSPID" at the end (instead of "fg"). One way to kill linuxsampler with with the command "killall -q linuxsampler". If NSM allows you to supply a "kill" script you could use that. |
|
From: rosea.grammostola <ros...@gm...> - 2012-04-10 18:48:10
|
On 04/10/2012 08:27 PM, Edward Diehl wrote: > > I do not know anything about how NSM kills applications at the end of a > session so I can only offer general comments. I see your script just > brings linuxsampler to the foreground (with fg command) which do not see > would be connected with killing linuxsampler, unless NSM sent a ^C the > script I see you save the process ID (LSPID), maybe NSM wants processes > to return the processID so it can kill the process at the end. If so you > could have your script return the LSPID by putting "echo $LSPID" at the end > (instead of "fg"). One way to kill linuxsampler with with the command > "killall -q linuxsampler". If NSM allows you to supply a "kill" script you > could use that. > Thanks. Is it only possible to load a lscp file via cat, or is there a other command line method to do this? Regards, \r |
|
From: rosea.grammostola <ros...@gm...> - 2012-04-10 20:40:58
|
On 04/10/2012 10:18 PM, Luis Garrido wrote: > Maybe something like this will work, since apparently nsmd sends SIGTERM > to the applications involved in the session when the 'quit' command is > activated: > > #!/bin/bash > > linuxsampler & > LSPID=$! > sleep 4 > nc localhost 8888 < myfile.lscp > trap "kill $LSPID" SIGTERM > wait $LSPID Thanks, but the lscp file should be loaded as argument in the proxy app in NSM. So in my previous script I have $1, which should allow me to add the lscp file as argument in the proxy app in NSM. Anyway, this doesn't kill it either. Regards, \r |
|
From: Luis G. <lui...@us...> - 2012-04-10 22:06:29
|
On 04/10/2012 10:40 PM, rosea.grammostola wrote: > Thanks, but the lscp file should be loaded as argument in the proxy app > in NSM. So in my previous script I have $1, which should allow me to add > the lscp file as argument in the proxy app in NSM. Sure, it was just an example for the process management logic. > Anyway, this doesn't kill it either. > Strange, out of curiosity I built the non-stuff here and everything works as expected. When I click the Close button both the script and LS are terminated. Luis |
|
From: rosea.grammostola <ros...@gm...> - 2012-04-10 22:26:27
|
On 04/11/2012 12:06 AM, Luis Garrido wrote: > On 04/10/2012 10:40 PM, rosea.grammostola wrote: > >> Thanks, but the lscp file should be loaded as argument in the proxy app >> in NSM. So in my previous script I have $1, which should allow me to add >> the lscp file as argument in the proxy app in NSM. > > Sure, it was just an example for the process management logic. > >> Anyway, this doesn't kill it either. >> > > Strange, out of curiosity I built the non-stuff here and everything > works as expected. When I click the Close button both the script and LS > are terminated. Did you also build the nsm-proxy (branch) and added the script via client nsm-proxy? |
|
From: Luis G. <lui...@us...> - 2012-04-10 22:37:55
|
On 04/11/2012 12:25 AM, rosea.grammostola wrote: > Did you also build the nsm-proxy (branch) and added the script via > client nsm-proxy? Nope, just fired up nsmd and non-session-manager, created a session, added the script via the GUI and started and closed the session several times to check it worked. Luis |
|
From: rosea.grammostola <ros...@gm...> - 2012-04-11 10:07:11
|
On 04/11/2012 12:37 AM, Luis Garrido wrote: > On 04/11/2012 12:25 AM, rosea.grammostola wrote: > >> Did you also build the nsm-proxy (branch) and added the script via >> client nsm-proxy? > > Nope, just fired up nsmd and non-session-manager, created a session, > added the script via the GUI and started and closed the session several > times to check it worked. > > Luis Maybe you could try to build the nsm-proxy, and add it as client. Use this script as binary and add an lscp file to the arguments of the nsm-proxy. This script *should* work, but here it doesn't. Maybe I miss something. Would be nice if you could give it a shot. #!/bin/bash linuxsampler & LSPID=$! # wait for LS to init sleep 4; # tell it what file to load cat "$1" | nc localhost 8888 #handle SIGTERM from NSM by killing LS. trap `kill -KILL $LSPID` SIGTERM #wait for LS to die naturally wait $LSPID > > ------------------------------------------------------------------------------ > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > _______________________________________________ > Linuxsampler-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel |
|
From: Luis G. <lui...@us...> - 2012-04-11 10:21:54
|
On 04/11/2012 12:12 PM, rosea.grammostola wrote: >> trap `kill -KILL $LSPID` SIGTERM Are you really using backquotes here ?????????? Change them to single or double quotes. You don't need to specify any signal for the kill command. |
|
From: rosea.grammostola <ros...@gm...> - 2012-04-11 10:27:01
|
On 04/11/2012 12:21 PM, Luis Garrido wrote: > On 04/11/2012 12:12 PM, rosea.grammostola wrote: > >>> trap `kill -KILL $LSPID` SIGTERM > > > Are you really using backquotes here ?????????? Change them to single or > double quotes. You don't need to specify any signal for the kill command. Ok, but doesn't help. All is started via the nsm-proxy, but when stopping the proxy, LS still runs unfortunately |
|
From: rosea.grammostola <ros...@gm...> - 2012-04-11 12:07:35
|
On 04/11/2012 12:26 PM, rosea.grammostola wrote: > On 04/11/2012 12:21 PM, Luis Garrido wrote: >> On 04/11/2012 12:12 PM, rosea.grammostola wrote: >> >>>> trap `kill -KILL $LSPID` SIGTERM >> >> >> Are you really using backquotes here ?????????? Change them to single or >> double quotes. You don't need to specify any signal for the kill command. > > Ok, but doesn't help. All is started via the nsm-proxy, but when > stopping the proxy, LS still runs unfortunately For clarity, I have it now like this #!/bin/bash linuxsampler --instruments-db-location=/home/derick/linuxaudio/linuxsampler/dericks_instruments.db & LSPID=$! # wait for LS to init sleep 4; # tell it what file to load cat "$1" | nc localhost 8888 #handle SIGTERM from NSM by killing LS. trap 'kill -TERM $LSPID' SIGTERM #wait for LS to die naturally wait $LSPID |
|
From: rosea.grammostola <ros...@gm...> - 2012-04-11 10:13:35
|
On 04/11/2012 12:06 PM, rosea.grammostola wrote: > On 04/11/2012 12:37 AM, Luis Garrido wrote: >> On 04/11/2012 12:25 AM, rosea.grammostola wrote: >> >>> Did you also build the nsm-proxy (branch) and added the script via >>> client nsm-proxy? >> >> Nope, just fired up nsmd and non-session-manager, created a session, >> added the script via the GUI and started and closed the session several >> times to check it worked. >> >> Luis > > Maybe you could try to build the nsm-proxy, and add it as client. Use > this script as binary and add an lscp file to the arguments of the > nsm-proxy. This script *should* work, but here it doesn't. Maybe I miss > something. Would be nice if you could give it a shot. > > #!/bin/bash > > linuxsampler & > > LSPID=$! > > # wait for LS to init > sleep 4; > > # tell it what file to load > cat "$1" | nc localhost 8888 > > #handle SIGTERM from NSM by killing LS. > trap `kill -KILL $LSPID` SIGTERM or trap `kill -TERM $LSPID` SIGTERM > > #wait for LS to die naturally > wait $LSPID > > > > > > > > > > > > > > > > > > > > > > > > > >> >> ------------------------------------------------------------------------------ >> >> Better than sec? Nothing is better than sec when it comes to >> monitoring Big Data applications. Try Boundary one-second >> resolution app monitoring today. Free. >> http://p.sf.net/sfu/Boundary-dev2dev >> _______________________________________________ >> Linuxsampler-devel mailing list >> Lin...@li... >> https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel > |