You are not logged in.
I have an old computer running Arch Linux, on which I'd like to run a bash script that takes several days to execute. The trouble is that after a few hours, if I'm running the script on it, the computer always shuts itself off - I'm guessing it's overheating. I have two questions...
1. Is there a way I can force the machine to slow down, either by somehow running the script more slowly, or by telling Arch Linux to generally use less resources or something?
2. Does Linux provide any sort of exit code or something that I could use to troubleshoot / confirm the issue is in fact overheating and not something else?
Last edited by tony5429 (2021-09-17 01:00:30)
Offline
I'm guessing
Why guess? Add some diagnostic checks and know for sure.
... by somehow running the script more slowly
That would depend on the script. Can you post / link to it so we can see what you are talking about? Assuming it's running some other processes in a loop, you can add a `sleep` between loops. But really, add diagnostics / logging first to see what's actually happening.
2. Does Linux provide any sort of exit code...
Every processes (like all those your script calls) has an exit code ... and you should be checking them.
The kernel itself doesn't, as there'd be nothing to receive it. But there is a journal. You should check that too - and post / link to it here if you want help.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Is there a way I can force the machine to slow down, either by somehow running the script more slowly, or by telling Arch Linux to generally use less resources or something?
You can use something like cpulimit.
Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.
Offline
I'm guessing it's overheating
lm_sensors gives you a way to check temperatures on the fly
Offline
I'd also open the case and remove at least some of the dust… ![]()
If the system is prone to emergency shutdowns, your chances to complete a long running process are zero.
If you cannot anything about the former, the script should better store intermediate results and be able to continue from there.
Offline
'cgroups' can also limit resources.
https://wiki.archlinux.org/title/cgroups
None of these 'limiters' are a solution for an unstable or overheated system though.
sys2064
Offline
i ran into the same issue, it was definitely an overheating problem for me. my old laptop was very dusty on the inside and the fan was clogged, had to dismantle the laptop, cleaned it thoroughly, removed and scrubbed the old dry thermal paste from the cpu surface, applied some fresh thermal paste and i was good to go, temperatures went down, no more sudden shutdowns (or hibernation) and the fans weren't loud, it sustains pretty well now.
archlinux cures my depression.
Offline
Thanks for all the tips/info! So, I've isolated the issue to Wifi. It's an old enough laptop that it has one of those little physical switches to turn the Wifi on/off. I actually have no need for wifi on the machine, so I just switched it off and that has solved the issue. If I ever need to use the Wifi, I'll do some more troubleshooting.
Offline