Page 1 of 1

EXEC BGND problems

Posted: Wed Feb 16, 2011 3:31 pm
by barry.marcus
I really thought that this issue was resolved a while ago, but I just began to revisit it and alas...

I am attempting to simply spawn a background process using EXEC BKGND on a remote server, so that the routine that spawns the remote process does not have to wait for the remote process to finish before it (i.e., the spawning process) itself finishes. Here is the code, in the file D:\Crosshairs\script\utility\asyncTest, on the REMOTE server:

<script language=Vortex>
<timeout=-1></timeout>

<a name=spawnLongWait PUBLIC>
<local theCommand>

<$texis="C:\MORPH3\texis.exe">
<$scriptPath="D:\Crosshairs\script">

<strfmt "%s %s\\utility\\asyncTest\\longWait.txt" $texis $scriptPath>
<$theCommand=$ret>
<exec bkgnd domain=theDomain user=theUser pass=thePassword $theCommand></exec>
</a>

<a name=longWait PUBLIC>
<vxcp timeout -1>
<sleep 60>
</a>
</script>

On the LOCAL server I am submitting the following url:

http://our.domain.name/texiscgi/texis.e ... ngWait.txt

(Note that for security reasons I have changed our domain name, the user name and the password, but THEY ARE CORRECT IN THE ACTUAL CODE)

On the remote server, texis.exe is correctly installed at C:\MORPH3. When I submit the URL I get the following error in the REMOTE Vortex.log:

018 2011-02-16 15:05:43 /utility/asyncTest:19: Cannot exec `C:\MORPH3\texis.exe D:\Crosshairs\script\utility\asyncTest\longWait.txt': The filename, directory name, or volume label syntax is incorrect in the function TXpopenduplex

It's clear that function spawnLongWait is being called. But the call to EXEC within that function is failing (with the above error). What is interesting is that from a command line ON THE REMOTE SERVER, the following command works perfectly well:

C:\MORPH3\texis.exe D:\Crosshairs\script\utility\asyncTest\longWait.txt

This is the very same command line (I think) that is being issued by the EXEC.

The output of texis -version on both servers is:

Commercial Version 6.00.1289279282 20101109 (i686-intel-winnt-64-32)

Thanks for your help on this issue.

EXEC BGND problems

Posted: Wed Feb 16, 2011 3:50 pm
by mark
The first non-option parameter to <exec> is the program to run. Remaining are arguments passed to that program. Arguments are not passed via a shell so it's safe to use special characters etc.

<strfmt "%s\\utility\\asyncTest\\longWait.txt" $scriptPath>
<$theScript=$ret>
<exec bkgnd domain=theDomain user=theUser pass=thePassword $texis $theScript></exec>

EXEC BGND problems

Posted: Wed Feb 16, 2011 3:51 pm
by John
With Version 6 you should either separate the $texis and script as arguments or use NOQUOTEARGS. E.g.

<strfmt "%s\\utility\\asyncTest\\longWait.txt" $scriptPath>
<$theScript=$ret>
<exec bkgnd domain=theDomain user=theUser pass=thePassword $texis $theScript>

EXEC BGND problems

Posted: Wed Feb 16, 2011 3:55 pm
by John
Windows version uses CreateProcess(), not exec(), which does do command line parsing, and Vortex now does quoting to make it behave more like exec.

EXEC BGND problems

Posted: Wed Feb 16, 2011 4:20 pm
by barry.marcus
Thanks Mark and John! Separating the command name (texis) from the script name worked. Back in business...