Please could you tell us why the return code from Perl is not returned to the application that we have developed.
We developed C command that wraps Perl command to collect information from the ESX server.
Our application works as follows:
1. The daemon starts the command written in C (C command).
*There is a possibility that the daemon starts more than one process at the same time.
2. Perl command(Perl.exe or Perl script) is executed by C command , to collect information from the ESX server.
*They is a possibility that several processes of Perl command starts at the same time.
Because processes of Perl command are executed by several processes of C command(which are executed by the dameon).
3. Perl command that runs first time , collects the information from ESX sever, and export the information as a text.
Perl command that runs after that , waits for the text to be exported.
4. After (3), Perl command analyze the text, and returns necessary information for each process to the C command.
5. C command returns the infomation (4) to the daemon.
However, the process of C command often time out , and they are killed by the daemon.
The daemon monitors the child processes, and it determine to kill the process if it's timed out.
Perl script outputs the logs at the start and the end of operation.
From the logs ,we could see that the process had been finished successfully.
But, after the logs had been written, the exit code that should be returned from Perl command to C command had not been returned.
And few minutes later, the process of C command had been killed by the daemon.
We think that this problem had occurred because there were something wrong in Perl command .
Please tell us why this problem had occurred and if there are any similar cases.
As long as we have examined, we think this case is similar to the following case.
In the following case, Perl command hangs by waitpid in Windows environment .
http://stackoverflow.com/questions/12011300/perls-waitpid-and-ipcopen2-in-windows-vs-linux-unix
OS:
Microsoft Windows Server 2008 R2 Enterprise
OSver:
6.1.7601 Service Pack 1 build 7601
x64-based PC
SDK:
vSphere SDK for Perl version: 5.0
Script 'vmware-cmd.pl' version: 5.0
perl -v:
This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 50 registered patches, see perl -V for more detail)<\p>