in reply to ctrl-c'ing

Have you determined the reason why the program doesn't exit? Is it waiting for user interaction or some other signal? You should avoid terminating a program in a way that it wasn't expecting as the program doesn't get a chance to tidy up.