2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

pwmconfig: Don't start if fancontrol is running.

fancontrol: Don't start if already running, delete fancontrol.pid at
exit time.
This closes ticket #2299.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5180 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2008-04-16 14:29:01 +00:00
parent be4ea8ac3e
commit 17e7247f28
4 changed files with 25 additions and 3 deletions

View File

@@ -9,6 +9,9 @@ SVN-HEAD
pwmconfig: Don't create the configuration file before it's needed
Don't preserve configuration file customizations
Fix permissions of the configuration file
Don't start if fancontrol is running (#2299)
fancontrol: Don't start if already running (#2299)
Delete fancontrol.pid at exit time (#2299)
sensors-detect: Add SMSC SCH5027D detection
Do not access I/O ports on PPC
Move south bridge sensor detection to the right section

View File

@@ -34,7 +34,6 @@ stop()
echo -n "Stopping fancontrol daemon"
killproc $FANCONTROL
RETVAL=$?
rm -f $PIDFILE
rm -f /var/lock/subsys/fancontrol
echo
}

View File

@@ -22,7 +22,7 @@
#
#
# Copyright 2003 Marius Reiner <marius.reiner@hdev.de>
# Copyright (C) 2007 Jean Delvare <khali@linux-fr.org>
# Copyright (C) 2007-2008 Jean Delvare <khali@linux-fr.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -41,10 +41,17 @@
#
#
PIDFILE="/var/run/fancontrol.pid"
#DEBUG=1
MAX=255
echo $$ > /var/run/fancontrol.pid
if [ -f "$PIDFILE" ]
then
echo "File $PIDFILE exists, is fancontrol already running?"
exit 1
fi
echo $$ > "$PIDFILE"
declare -i pwmval
@@ -248,6 +255,7 @@ function restorefans()
let fcvcount=$fcvcount+1
done
echo 'Verify fans have returned to full speed'
rm -f "$PIDFILE"
exit $status
}

View File

@@ -27,6 +27,18 @@
# MA 02110-1301 USA.
#
#
PIDFILE="/var/run/fancontrol.pid"
if [ -f "$PIDFILE" ]
then
echo "File $PIDFILE exists. This typically means that the"
echo "fancontrol deamon is running. You should stop it before running pwmconfig."
echo "If you are certain that fancontrol is not running, then you can delete"
echo "$PIDFILE manually."
exit 1
fi
echo 'This program will search your sensors for pulse width modulation (pwm)'
echo 'controls, and test each one to see if it controls a fan on'
echo 'your motherboard. Note that many motherboards do not have pwm'