I have an exe file compiled from C++ code. And I use bash to set up Linux environment and to call this .exe
programme.
Now coming to the problem, most of the time, users would like to use ctrlc to kill the processes when they finish using the programme or when they don't want to continue.
The bash process is terminated by ctrlc properly, however, the .exe
is usually running without being killed. So users need to use kill -9 xxx
to kill the process. If they forget to kill, their CPU could be fully occupied.
How shall I proceed to solve this problem ? Shall I do something for the code of exe file or for the bash script?
Thanks