Closed antondalgren closed 5 years ago
The problem is shell=True
. Python spawns a shell, which then spawns cpu-energy-meter
, and the signal is sent to the shell instead of cpu-energy-meter
. Without this, it works.
In general, one should avoid shell=True
anyway for security reasons.
Note that if you call cpu-energy-meter
from another process and want to parse its arguments, make sure to pass -r
(and not -d
).
@PhilippWendler Yes thats it, thanks alot!
Hi
I'm using this tool to measure the energy usage of the CPU in benchmark suite. I'm having trouble to send the
SIGINT
signal to the process.Im using python3 for this and both running the multiprocessing module and the subprocess module as seen below.
Do you have any suggestions on how to get this
SIGINT
to actually get through?