i've done a starting script in init.d for fancontrol to handle the different configurations :
First create fancontrol, fancontrol1, fancontrol2 configuration files for fancontrol with different configurations you can have (you can have only two or more than three conf files)
For now then fancontrol daemon always starts without fails....
Hope this could be useful for others
With only one week of linux practice, i'm proud of this script ! ^^
Sorry for my english i'm french ^
i've done a starting script in init.d for fancontrol to handle the different configurations :
First create fancontrol, fancontrol1, fancontrol2 configuration files for fancontrol with different configurations you can have (you can have only two or more than three conf files)
then here is the script :
******* ******* ******* ******* ******* ******* ***
#!/bin/sh
#
# Fancontrol start script.
#
set -e
# Defaults /usr/sbin/ fancontrol /var/run/ fancontrol. pid /bin:/usr/ sbin:/usr/ bin /etc/fancontol /etc/fancontol1 /etc/fancontol2
DAEMON=
PIDFILE=
PATH=/sbin:
CONFIG1=
CONFIG2=
CONFIG3=
test -f $DAEMON || exit 0
. /lib/lsb/ init-functions
case "$1" in
log_begin_ msg "Starting fancontrol config 1..."
start- stop-daemon --start -o -b -p $PIDFILE -x $DAEMON $CONFIG2
log_success_ msg "redémarrage configuration ok1"
log_end_ msg $?
start)
log_end_msg $?
sleep 1
if start-stop-daemon --stop -q -p $PIDFILE ; then
start-stop-daemon --start -o -b -p $PIDFILE -x $DAEMON $CONFIG2
exit 0
else
rm -f $PIDFILE
fi
log_begin_msg "Starting fancontrol config 2..."
start- stop-daemon --start -o -b -p $PIDFILE -x $DAEMON $CONFIG1
log_success_ msg "redémarrage configuration ok2"
log_end_ msg $?
log_end_msg $?
sleep 1
if start-stop-daemon --stop -q -p $PIDFILE ; then
start-stop-daemon --start -o -b -p $PIDFILE -x $DAEMON $CONFIG1
exit 0
else
rm -f $PIDFILE
fi
log_begin_msg "Starting fancontrol config 3..."
start- stop-daemon --start -o -b -p $PIDFILE -x $DAEMON $CONFIG3
log_success_ msg "redémarrage configuration ok3"
log_end_ msg $?
log_begin_ msg "Stopping fancontrol daemon..."
start- stop-daemon --stop -o -q -p $PIDFILE
log_end_ msg $?
force- reload| restart)
log_success_ msg "Usage: /etc/init. d/fancontrol {start| stop|restart| force-reload} "
log_success_ msg " start - starts system-wide fancontrol service"
log_success_ msg " stop - stops system-wide fancontrol service"
log_success_ msg " restart, force-reload - starts a new system-wide fancontrol service"
exit 1
log_end_msg $?
sleep 1
if start-stop-daemon --stop -q -p $PIDFILE ; then
start-stop-daemon --start -o -b -p $PIDFILE -x $DAEMON $CONFIG3
exit 0
else
rm -f $PIDFILE
fi
;;
stop)
rm -f $PIDFILE
;;
sh $0 stop
sh $0 start
;;
*)
;;
esac
exit 0 ******* ******* ******* ******* ***
*******
For now then fancontrol daemon always starts without fails....
Hope this could be useful for others
With only one week of linux practice, i'm proud of this script ! ^^