How to triger a timer/signal to a running program

nicholas wang nickone at 263.net
Mon Jul 1 08:12:04 EDT 2002


Hi,all
  My task is to kill a program when it runs more than a limited time.
  My plat is Linux7.1; I've tried Csh to make it using ps ... ; then kill
this program. But it will get extra  messages to stdout. Of course, use
"limit" command also works. But both are not perfect.
  I know Perl get a command "alarm" will do such a job
  I'm searching a Python counterpart. Does anyone know what it is?
My idea about this job is: ( in a python shell )
  1. mark a signal to a specific program.
  2. run this program
  3. if time exceeds limit(set before run), the shell will kill it.
  2. continue to run the remained commands.

Thanks to you!!





More information about the Python-list mailing list