Fancontrol은 수동으로 시작되지만 서비스로 실패합니다.

Fancontrol은 수동으로 시작되지만 서비스로 실패합니다.

터미널에서 팬 제어를 시작하면 제대로 작동합니다.

# 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...

그러나 팬 제어를 서비스로 시작하면(부팅 시 또는 부팅 후) 실패합니다.

# service fancontrol start
[ ok ] Starting fan speed regulator: fancontrol.
# service fancontrol status
[FAIL] fancontrol is not running ... failed!

팬 제어를 서비스로 시작하는 것과 실패하게 만드는 수동으로 시작하는 것의 차이점은 무엇입니까?

Debian Wheezy Fancontrol 초기화 스크립트

#! /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

그거였다! fancontrol은 이제 완벽하게 작동하며 부팅 시 시작됩니다.

관련 정보