[Gambas-user] help with EXEC usage

Benoît Minisini gambas at ...1...
Fri Mar 25 00:21:52 CET 2011


> > Bit short of time... but quickly looking at this.
> > I'm not sure but I think this problem has something to do with fact that
> > you are starting two process with shell command.
> > And I'm not sure how Gambas2 handles these... does it try to kill the
> > shell itself, or process started with command shell.
> > 
> > So, you can try retrieve separated process pids (for get_iplayer and for
> > mplayer) with pgrep, and use them to kill those processes.
> > 
> > Maybe this is bug, Benoit?
> > 
> > Jussi
> 
> Gambas kills the shell process by sending it the SIGKILL signal. He is not
> aware of the processes run by the shell itself, and I don't know if the
> shell kills its child processes automatically when being killed.

Yes: I have just tested inside a terminal.

If I run a shell, then run mplayer inside the shell, sending SIGKILL to the 
shell will kills it, but not mplayer.

BUT: if you send the SIGHUP signal to the shell, it will quit correctly by 
closing all its children first.

So you can try that. In Gambas 2, you have to use the shell command "kill", so 
you have to run SHELL again to kill the first one!

Regards,

-- 
Benoît Minisini




More information about the User mailing list