Startup Script Question

Dunuin

Contributor
Joined
Mar 7, 2013
Messages
110
Hi,

I wrote a bash script to control the fan speed with ipmitool. If I run it from console as root with "bash /mnt/SSDpool/localData/scripts/fanctrl.sh" it works fine but if I use the same command or script via the "init/shutdown script" webinterface I get the error:
/mnt/SSDpool/localData/scripts/fanctrl.sh: line 37: ipmitool command not found

Line 37 is:
CPUSENSOR=$(ipmitool sensor get "CPU Temp")

Which user runs the init scripts? Does that user didn't have the rights to run the ipmitool?
 

colmconn

Contributor
Joined
Jul 28, 2015
Messages
174
Use the pull path to ipmitool in the script since it appears to not be on the PATH hence the error
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
Hi,

I wrote a bash script to control the fan speed with ipmitool. If I run it from console as root with "bash /mnt/SSDpool/localData/scripts/fanctrl.sh" it works fine but if I use the same command or script via the "init/shutdown script" webinterface I get the error:
/mnt/SSDpool/localData/scripts/fanctrl.sh: line 37: ipmitool command not found

Line 37 is:
CPUSENSOR=$(ipmitool sensor get "CPU Temp")

Which user runs the init scripts? Does that user didn't have the rights to run the ipmitool?
Right, for some reason in scripts you have to give the path to many commands like ipmitool. I think you can find that with which ipmitool.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
Yes, and there's mine, which I think Kevin's is based on.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Yes, and there's mine, which I think Kevin's is based on.
Indeed the PID logic is the core of the whole story, so apologies that I left you off the list.
 

Dunuin

Contributor
Joined
Mar 7, 2013
Messages
110
That works:
CPUSENSOR=$(/usr/local/bin/ipmitool sensor get "CPU Temp")

My script is simple and ugly but works now.
I bought a Arctic Cooling Freezer 7 Pro Rev2 because I had seen a FreeNAS build with my X10SSL-F mainboard so I could be sure it will fit. The problem is, that the fan of that cooler is a little bit loud at 50% PWM and will stop spinning if the PWM is falling below 30%. And the only other option the IPMI webinterface allows is 25%-100% so the fan is always failing at 25% PWM and as soon as the RPM reaches 0 the IPMI panics and boosts PWM up to 100%, so the fan is switching between 0 and 2100 RPM all 10 seconds. But if you set the minimum fan threshold to 30% via ipmitool it will run at stable 900-1000 RPM and is not recognizable. But you have to do it again after every boot, because the IPMI wont save the threshold permanently.
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The scripts I mentioned allow for a minumum no-stall speed.

Anyway, go your own way if that works for you.
 
Top