ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject shutdown hooks and ctrl-c's
Date Tue, 20 Nov 2001 18:49:18 GMT
When Ant forks off processes (particularly java), is it possible for Ant to
forward ctrl-c's to the forked process?  That would allow any shutdown hooks
that the process has registered to be run...  Right now, when I hit ctrl-C
ant dies and my program never gets the signal.

The following shutdown hook might work, well, that is assuming that
Process.destroy() is similar to a ctrl-c event.  Ant just adds and removes
new process-specific shutdown hooks before and after it forks off other

class ProcessShutdownHook
  extends Thread
  private Process process;

  ProcessShutdownHook(Process process)
    this.process = process;

  public void run()
    // does destroy act like a ctrl-c, in that it
    // will wait for shutdown hooks to run?

Anyway, I would like to use ant instead of scripts, and I need this
functionality.  If this is available somehow, and I've missed it, please
e-mail me how to accomplish the desired behavior.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message