Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by phyllisdillon

  1. phyllisdillon

    kill process after time-out

    Alarm seems to be working yet better. This code is running without problems (somehow ` ` seems to be working better than system()...): eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm 90; $? = `program.exe --param1 1 --param2 2`; alarm 0; }; if ($@) { # timed out die unless...
  2. phyllisdillon

    kill process after time-out

    Hey! Thanks for the help! One question about fork() & kill(). I have tried it this way now, giving program.exe 2 minutes to finish: my $child_PID = fork(); if ( $child_PID ) { sleep 60; if( kill 0, 0 ) { sleep 60; print "process killed, timeout" if( kill 1, 0 ); } } elsif (...
  3. phyllisdillon

    kill process after time-out

    No, it is not my program, so I cannot influence that... I have to accept the fact that it will sometimes hang and try to deal with it somehow.
  4. phyllisdillon

    kill process after time-out

    Hello, I want to start a program from my perlscript and put the result in a database. The following code is run in a loop, changing param1 and param2: my @args=("program.exe", "--param1", "1", "--param2", "2"); system( @args ); my $exitcode=$?/256; It works fine, but sometimes...

Part and Inventory Search

Back
Top