I'm temporarily forced to work on a laptop whose fan has failed. Under light load it works fine, but as soon as I start computationally intensive jobs, the temperature raises very significantly, even when the cpufreq is pegged to the minimum.
I'd like to automate something i'm doing by hand for now, suspending the expensive job with Ctrl-Z when the temperature raises above some threshold, and resume it when the temperature drops below a certain point.
Is there an existing command or wrapper script that does that, before I write my own ?
Running a single job under a wrapper would be enough, but it would be nicer if it could suspend a whole class of tasks; unfortunately I cannot easily run all my expensive jobs under some user, but I could renice them, and suspend all the niced jobs when it overheats.