This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problems in Perl process management


Hello - 

I'd appreciate help with problems doing process management in Cygwin/Perl. 

I have a Perl application that creates child processes - I need it to kill
processes that exceed a certain timeout. I am trying to use the
Proc::ProcessTable and Proc::Killfam CPAN modules for this.

I ran into two problems: 

The first problem was a "can't stat /dev" error message produced when
calling Proc::Killfam. This problem was fixed by a script I found that
populated entries under /dev. 

To understand the next probem, have a look at the simple test script
attached. The script forks a child process, which runs `sleep` in a third
process. The parent process then tries to kill both children on expiry of a
timeout. The script behaves perfectly on Linux -- it works as expected and
kills the fork-ed child Perl process, as well it's `sleep` child process.
However, on Cygwin/Perl it only kills the fork-ed Perl child - it cannot
kill the `sleep`-ing child. 

The problem seems to be that the process table data returned by
Proc::ProcessTable seems to differ from the data returned 'ps'.
Specifically, Proc::ProcessTable returns the WINPID of a process as the PID
for the backticked `sleep` process. 

The closest issue I found in the list archives is this one: 
        http://sourceware.org/ml/cygwin/2005-02/msg00224.html 
It does not seem to have been resolved. 

I'm running Perl on Cygwin on Windows XP SP2. Running 'cygcheck -c' gives
the following package status for cygwin and Perl:
--------------------------
cygwin  1.5.16-1   OK
perl    5.8.6-4    OK
--------------------------

Can anyone help?

Regards,
Sonam Chauhan
-- 
Electronic Commerce, Corporate Express Australia Ltd.
Phone: +61-2-9335-0725, Email: sonam.chauhan@ce.com.au
 


Attachment: timeout_test2.pl
Description: Binary data

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]