I'm working on a Java application that utilises shutdown hooks in order to clean up on termination/interruption of the program, but I've noticed that Cygwin's implementation of CTRL-C doesn't seem to trigger the shutdown hooks. On the surface it appears to have interrupted the process, relinquishing control back to the command line, however the process' shutdown hooks are not triggered at all so cleanup does not occur.
In cmd they get caught, but due to various constraints I need to somehow get them working in Cygwin.
Is there any way to fire a SIGINT at a running process through Cygwin at all, or perhaps an alternative to shutdown hooks that I could use to clean up on interruption and termination?