![ファンコントロールは手動で開始されますが、サービスとして失敗します](https://rvso.com/image/1416347/%E3%83%95%E3%82%A1%E3%83%B3%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%AB%E3%81%AF%E6%89%8B%E5%8B%95%E3%81%A7%E9%96%8B%E5%A7%8B%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9%E3%81%A8%E3%81%97%E3%81%A6%E5%A4%B1%E6%95%97%E3%81%97%E3%81%BE%E3%81%99.png)
ターミナルからファンコントロールを起動すると正常に動作します
# fancontrol
Loading configuration from /etc/fancontrol ...
Common settings:
INTERVAL=2
Settings for /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/pwm1:
Depends on /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon[[:print:]]*/device/temp1_input
Controls /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/fan1_input
MINTEMP=17
MAXTEMP=53
MINSTART=140
MINSTOP=50
MINPWM=0
MAXPWM=255
Settings for /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/pwm3:
Depends on /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon[[:print:]]*/device/temp1_input
Controls /sys/devices/platform/it87.656/hwmon/hwmon[[:print:]]*/device/fan2_input
MINTEMP=17
MAXTEMP=55
MINSTART=140
MINSTOP=50
MINPWM=0
MAXPWM=255
Enabling PWM on fans...
Starting automatic fan control...
ただし、fancontrol をサービスとして起動すると (起動時または起動後に) 失敗します。
# service fancontrol start
[ ok ] Starting fan speed regulator: fancontrol.
# service fancontrol status
[FAIL] fancontrol is not running ... failed!
fancontrol をサービスとして起動する場合と、手動で起動する場合の違いは何ですか。手動で起動すると失敗します。
Debian Wheezy ファンコントロール initscript
#! /bin/sh
### BEGIN INIT INFO
# Provides: fancontrol
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: fancontrol
# Description: fan speed regulator
### END INIT INFO
. /lib/lsb/init-functions
[ -f /etc/default/rcS ] && . /etc/default/rcS
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/fancontrol
DESC="fan speed regulator"
NAME="fancontrol"
PIDFILE=/var/run/fancontrol.pid
CONF=/etc/fancontrol
test -x $DAEMON || exit 0
case "$1" in
start)
if [ -f $CONF ] ; then
if $DAEMON --check 1>/dev/null 2>/dev/null ; then
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet --background --pidfile $PIDFILE --startas $DAEMON
log_end_msg $?
else
log_failure_msg "Not starting fancontrol, broken configuration file; please re-run pwmconfig."
fi
else
if [ "$VERBOSE" != no ]; then
log_warning_msg "Not starting fancontrol; run pwmconfig first."
fi
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --startas $DAEMON
rm -f $PIDFILE
log_end_msg $?
;;
restart)
$0 stop
答え1
バカバカしい気がします。もっと調べるべきでした。私が間違えたり、他の誰かが同じ問題を抱えている場合に備えて、ここに答えを記しておきます。また、アドバイスをくれて正しい方向を示してくれた @Fiisch にも感謝します。
#service fancontrol start
または経由でファンコントロールを起動すると#fancontrol
、/usr/sbin/fancontrolのエラーが出力されません。マザーボードの制限により、センサーは絶対パスとして定義されています。そのため、/usr/sbin/fancontrolを実行しました。これにより、エラーが発生します。
Configuration is too old, please run pwmconfig again
そこで、/usr/sbin/fancontrol を見て原因を調べることにしました。302 行目から 307 行目に原因が見つかりました。
# Check for configuration change
if [ -z "$DEVPATH" -o -z "$DEVNAME" ]
then
echo "Configuration is too old, please run pwmconfig again" >&2
exit 1
fi
これは単なる単純な構成変更検出器です。センサーの絶対パスを指定していたため、これは必要ないだけでなく、実際にエラーの原因となっていました。そのため、コメントアウトしました。
## Check for configuration change
#if [ -z "$DEVPATH" -o -z "$DEVNAME" ]
#then
# echo "Configuration is too old, please run pwmconfig again" >&2
# exit 1
#fi
これで完了です。ファンコントロールは完璧に動作し、起動時に起動します。