Fancontrol startet manuell, schlägt aber als Dienst fehl

Fancontrol startet manuell, schlägt aber als Dienst fehl

Wenn fancontrol vom Terminal aus gestartet wird, funktioniert es einwandfrei

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

Beim Starten von Fancontrol als Dienst (beim oder nach dem Booten) schlägt dies jedoch fehl.

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

Welchen Unterschied macht es, ob man die Lüftersteuerung als Dienst oder manuell startet, was zu einem Fehler führen würde?

Debian Wheezy Fancontrol-Initskript

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

Antwort1

Ich fühle mich albern, hätte genauer nachforschen sollen. Hier ist die Antwort, falls ich es vermassle oder jemand anderes das gleiche Problem hat. Vielen Dank auch an @Fiisch für den Rat und den Hinweis in die richtige Richtung.

Beim Starten von fancontrol über #service fancontrol startoder #fancontrolwerden die Fehler von /usr/sbin/fancontrol nicht ausgegeben. Aufgrund von Motherboard-Einschränkungen sind meine Sensoren als absolute Pfade definiert. Daher habe ich /usr/sbin/fancontrol ausgeführt. Dies verursacht den Fehler

Configuration is too old, please run pwmconfig again

Also habe ich beschlossen, einen Blick auf /usr/sbin/fancontrol zu werfen, um herauszufinden, warum. Ich habe die Ursache in den Zeilen 302-307 gefunden:

# Check for configuration change
if [ -z "$DEVPATH" -o -z "$DEVNAME" ]
then
    echo "Configuration is too old, please run pwmconfig again" >&2
    exit 1
fi

Es handelt sich lediglich um einen einfachen Detektor für Konfigurationsänderungen! Da ich die absoluten Pfade für meine Sensoren angegeben hatte, war dies nicht nur nicht notwendig, sondern verursachte tatsächlich den Fehler. Also habe ich es einfach auskommentiert.

## Check for configuration change
#if [ -z "$DEVPATH" -o -z "$DEVNAME" ]
#then
#   echo "Configuration is too old, please run pwmconfig again" >&2
#   exit 1
#fi

Das war es! Die Lüftersteuerung funktioniert jetzt einwandfrei und startet beim Booten.

verwandte Informationen