oninit -i -y from PHP - cannot detect that command have exited
Posted in 2000
Hi all,
This little saga have to do with IDS (7.3 LE) oninit command, when
executed from PHP code using exec() or system()
Both exec() and system() in PHP are just like the C version of the
function in that it executes the given command and outputs the result.
Problem is, when PHP executes oninit like this, oninit runs fine, I can
see my db space being created, but PHP just hangs there waiting for
command to return to PHP, and it never does.
Everything else I run from PHP this way runs fine.
It was suggested that oninit does something "naughty" that prevents PHP
from detecting that exec() or system() have exited. Maybe something like
launching parallel threads, or something else that makes calling program
think something is still running...?
I even wrote a little shell script like this:
#!/bin/sh
export ONCONFIG=$1
export INFORMIXSERVER=$2echo INFORMIXSERVER is $INFORMIXSERVER
echo ONCONFIG is $ONCONFIG
echo running $INFORMIXDIR/bin/oninit -i -y
$INFORMIXDIR/bin/oninit -i -y
echo "done...Exit"
and I can successfully run it on command line (Linux RedHat 6) but if I
invoke it from PHP with exec or system, it will come to "done...Exit"
but never return to PHP.
No, it is not browser time out, server timeout or PHP timeout, I
actually see "done...Exit" in my browser.
Yes, I did try to put explicit "exit 99" et the end of shell script.
If I run onmode -ky after oninit -i, I can exit back to PHP, but I
cannot continue, since my engine is down. If I then try to do another
oninit to start the engine again, I have the same problem as with oninit
-i, PHP will not detect the script was finished.
Question: does any-one know what might be the reason why oninit prevents
system() from detecting that command exited, the moment oninit is in the
command?
Maybe a way to execute some command at the end of the shell script that
can force the calling program to see that script have terminated?
Any workarounds for this?
Any suggestions appreciated,
Thanks,
--
Yours, Andrej Falout, http://www.falout.com ICQ 7628616 ++64.21.607517
#-----------------------------------------------------------------
globals "std_disclaimer.4gl"
Ask yourself just one question: ' Qu' m's se puede hacer y aprender ?
- Propellerhead ReBirth RB-338 manual