Fancontrol se inicia manualmente pero falla como servicio

Fancontrol se inicia manualmente pero falla como servicio

Cuando el control del ventilador se inicia desde el terminal, funciona bien

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

Sin embargo, al iniciar fancontrol como servicio (durante el arranque o después), falla.

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

¿Cuál es la diferencia entre iniciar fancontrol como servicio y hacerlo manualmente, lo que provocaría que fallara?

Guión de inicio de 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

Respuesta1

Me siento tonto, debería haber investigado más. Aquí está la respuesta en caso de que me equivoque o alguien más tenga el mismo problema. Además, muchas gracias a @Fiisch por sus consejos y por indicarme la dirección correcta.

Al iniciar fancontrol mediante #service fancontrol starto #fancontrol, los errores de /usr/sbin/fancontrol no se imprimen. Debido a las limitaciones de la placa base, mis sensores se definen como rutas absolutas. Entonces ejecuté /usr/sbin/fancontrol. Esto causa el error

Configuration is too old, please run pwmconfig again

Así que decidí echar un vistazo a /usr/sbin/fancontrol para ver por qué. Encontré la causa en las líneas 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

¡Es solo un simple detector de cambio de configuración! Dado que había especificado las rutas absolutas para mis sensores, esto no solo no era necesario, sino que en realidad estaba causando el error. Así que simplemente lo comenté.

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

¡Eso fue todo! fancontrol funciona perfectamente ahora y se inicia en el momento del arranque.

información relacionada