Terminating a parent session...
Posted in 2004
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi All, We have an Informix 4gl interactive module, which when completes its execution must kill the Unix session itself. Is there any way of doing so. We are using this because we want to execute an application in a remote machine. For this expect tool executes an interactive moudle in other machine but when the program ends the control still remains on the remote machine & a manual "exit" needs to teyped to come to cleint machine. Regards, Vijay Kumar sending to informix-list
On Thu, 23 Sep 2004 02:55:28 -0400, Vijay Kumar wrote: Write a 4Gl callable 'C' function that gets the parent pid (ppid = getppid();) then sends a sighup signal to the parent shell (kill( ppid, SIGHUP ); ) and call it at the exit point(s) in the module. Art S. Kagel > Hi All, > > We have an Informix 4gl interactive module, which when completes its > execution must kill the Unix session itself. Is there any way of doing so. > We are using this because we want to execute an application in a remote > machine. For this expect tool executes an interactive moudle in other > machine but when the program ends the control still remains on the remote > machine & a manual "exit" needs to teyped to come to cleint machine. > > Regards, > Vijay Kumar > > sending to informix-list
Vijay Kumar wrote: > We have an Informix 4gl interactive module, which when completes its > execution must kill the Unix session itself. Is there any way of > doing so. We are using this because we want to execute an > application in a remote machine. For this expect tool executes an > interactive moudle in other machine but when the program ends the > control still remains on the remote machine & a manual "exit" needs > to teyped to come to cleint machine. It is a bit hard to tell exactly what your scenario is, but the answer is usually 'exec'. In general terms, if you run "exec echo Farewell", the shell replaces itself with the 'echo' command and when that terminates, the session terminates. Translated to I4GL, running "exec i4glprogram" means that the session (window, subshell, whatever) will terminate when i4glprogram terminates. Since you're running an I4GL program on a remote machine under the control of 'expect' (a Tcl/Tk tool for scripted driving of interactive programs), we'd need to know a lot more about how the I4GL program is being launched. A manual 'exit' should not be necessary; expect should expect to send exit. -- Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h> "I don't suffer from insanity - I enjoy every minute of it"