Re: avoiding periodic(8) during long poudriere runs

From: Miroslav Lachman <000.fbsd_at_quip.cz>
Date: Sat, 18 Feb 2023 20:46:43 UTC
On 18/02/2023 18:03, void wrote:
> Hello hackers@
> 
> Is there an established way of telling periodic to not run when load is 
> over a certain value? Or to delay running it until load goes (for 
> example) under 1.00 for 15 mins.

I don't know about any generic way, but you can put some shell code into 
/etc/periodic.conf to exit if load is too high

Just a quick and dirty example, exit if 5 minutes avg is higher than 1.1:

avg5load=$(top | awk '/load averages:/ { load=$7+0; if (load > 1.1) { 
print "HIGH" } }')
echo $avg5load
if [ "$avg5load" = "HIGH" ]; then
         echo "CPU load is too high"
         exit 5
fi

Kind regards
Miroslav Lachman