I'm getting cron errors in logread
from /sbin/fan_ctrl.sh
on a WRT1900AC v1 (mamba).
Sun Nov 28 11:00:00 2021 cron.err crond[1961]: USER root pid 3217 cmd /sbin/fan_ctrl.sh
Sun Nov 28 11:05:00 2021 cron.err crond[1961]: USER root pid 4032 cmd /sbin/fan_ctrl.sh
Sun Nov 28 11:10:00 2021 cron.err crond[1961]: USER root pid 5327 cmd /sbin/fan_ctrl.sh
Sun Nov 28 11:15:00 2021 cron.err crond[1961]: USER root pid 5867 cmd /sbin/fan_ctrl.sh
Sun Nov 28 11:20:00 2021 cron.err crond[1961]: USER root pid 6695 cmd /sbin/fan_ctrl.sh
Sun Nov 28 11:25:00 2021 cron.err crond[1961]: USER root pid 7272 cmd /sbin/fan_ctrl.sh
Sun Nov 28 11:30:00 2021 cron.err crond[1961]: USER root pid 8586 cmd /sbin/fan_ctrl.sh
There are no errors when running the script at the command line, so there's nothing to troubleshoot with the script, other than, perhaps the context cron
provides.
The hardware has a fan for sure. And it works.
OpenWrt 21.02.1 output from `uname -a`:
`Linux OpenWrt 5.4.154 #0 SMP Sun Oct 24 09:01:35 2021 armv7l GNU/Linux`
Resulting output from when running /sbin/fan_ctrl.sh
, after adding the -x switchon line 1:
+ cut -c1-2 /sys/class/hwmon/hwmon2/temp1_input
+ CPU_TEMP=71
+ cut -c1-2 /sys/class/hwmon/hwmon1/temp1_input
+ DDR_TEMP=55
+ cut -c1-2 /sys/class/hwmon/hwmon1/temp2_input
+ WIFI_TEMP=56
+ CPU_LOW=85
+ CPU_HIGH=95
+ DDR_LOW=65
+ DDR_HIGH=75
+ WIFI_LOW=100
+ WIFI_HIGH=115
+ '[' -d /sys/devices/pwm_fan ]
+ '[' -d /sys/devices/platform/pwm_fan ]
+ FAN_CTRL=/sys/devices/platform/pwm_fan/hwmon/hwmon0/pwm1
+ '[' 71 -ge 95 -o 55 -ge 75 -o 56 -ge 115 ]
+ '[' 71 -ge 85 -o 55 -ge 65 -o 56 -ge 100 ]
+ echo 0
it all looks fine. I've read this post but I don't need a procd fan replacement. The error is in cron.
the cron job seems to be the problem but the crontab looks just fine.
# mamba fan script runs every 5 minutes
*/5 * * * * /sbin/fan_ctrl.sh
what's going on?