Search
j0ke.net Open Build Service
>
Projects
>
stresslinux
>
sensors
> lm_sensors-3.0.0.dif
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File lm_sensors-3.0.0.dif of Package sensors (Revision 9)
Currently displaying revision
9
,
show latest
Index: Makefile =================================================================== --- Makefile.orig +++ Makefile @@ -38,7 +38,7 @@ DEBUG := 0 DESTDIR := # This is the prefix that will be used for almost all directories below. -PREFIX := /usr/local +PREFIX := /usr # Your C compiler CC := gcc @@ -71,7 +71,7 @@ LIBINCLUDEDIR := $(INCLUDEDIR)/sensors # You should not need to change this. It is the base directory under which the # manual pages will be installed. -MANDIR := $(PREFIX)/man +MANDIR := $(PREFIX)/share/man MACHINE := $(shell uname -m) @@ -133,7 +133,7 @@ ifeq ($(DEBUG),1) ALL_CPPFLAGS += -DDEBUG ALL_CFLAGS += -O -g else -ALL_CFLAGS += -O2 +ALL_CFLAGS += $(RPM_OPT_FLAGS) endif ifeq ($(WARN),1) Index: prog/detect/sensors-detect =================================================================== --- prog/detect/sensors-detect.orig +++ prog/detect/sensors-detect @@ -5945,6 +5945,8 @@ EOT print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n". "for initialization at boot time.\n" unless -f "/etc/init.d/lm_sensors"; + system("/sbin/insserv", "/etc/init.d/lm_sensors") + if -f "/etc/init.d/lm_sensors"; } } Index: prog/init/README =================================================================== --- prog/init/README.orig +++ prog/init/README @@ -10,7 +10,7 @@ The script lm_sensors.init is a nice sta On RH and other RH-based systems (MDK, notably) use this sort of startup mechanism (i.e. SVR4-based), as opposed to the everything-in-one-script (/etc/rc or /etc/rc.local) like the BSD-based systems do. -The lm_sensors.init file should be copied to /etc/rc.d/init.d/lm_sensors. +The lm_sensors.init file should be copied to /etc/init.d/lm_sensors. For more information see the top of the file. It requires the /etc/sysconfig/lm_sensors file, which identifies the correct modules. @@ -27,10 +27,10 @@ by Marc Rieffel <marc@paracel.com>. ---------------- The script sensord.init also loads the modules, and then -starts the sensord daemon. See the directory ../sensord for +starts the sensord daemon. See the manual page sensord(8) for more information on the daemon. -The sensord.init file should be copied to /etc/rc.d/init.d/sensord. +The sensord.init file should be copied to /etc/init.d/sensord. For more information see the top of the file. To configure this service one should put appropriate "alias i2c-bus-0 xxx" Index: prog/init/lm_sensors.init.suse =================================================================== --- prog/init/lm_sensors.init.suse.orig +++ prog/init/lm_sensors.init.suse @@ -1,19 +1,15 @@ #!/bin/sh # ### BEGIN INIT INFO -# Provides: lm_sensors -# Required-Start: $local_fs -# X-UnitedLinux-Should-Start: -# Required-Stop: $local_fs -# X-UnitedLinux-Should-Stop: -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Short-Description: LM Sensors -# Description: LM Sensors for hardware monitoring +# Provides: sensors +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 5 +# Default-Stop: +# Short-Description: Load and configure hardware monitoring drivers +# Description: sensors is used for monitoring motherboard sensor values. +# Config file is /etc/sysconfig/lm_sensors ### END INIT INFO -# chkconfig: 2345 26 74 -# description: sensors is used for monitoring motherboard sensor values. -# config: /etc/sysconfig/lm_sensors # # 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 @@ -40,115 +36,91 @@ # MODULE_1, MODULE_2, MODULE_3, etc. # If sensors isn't supported by the kernel, try loading the module... -[ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc &>/dev/null +[ -e /sys/bus/i2c/devices ] || /sbin/modprobe i2c-dev &>/dev/null # Don't bother if /proc/sensors still doesn't exist, kernel doesn't have # support for sensors. -[ -e /proc/sys/dev/sensors ] || exit 0 - +[ -e /sys/bus/i2c/devices ] || exit 0 + # If sensors was not already running, unload the module... -[ -e /var/lock/subsys/lm_sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null +[ -e /var/lock/subsys/sensors ] || /sbin/modprobe -r i2c-dev &>/dev/null CONFIG=/etc/sysconfig/lm_sensors -PSENSORS=/usr/local/bin/sensors +PSENSORS=/usr/bin/sensors +FANCONFIG=/etc/fancontrol +PFAN=/usr/sbin/fancontrol # Source function library. -#. /etc/init.d/functions - -# Shell functions sourced from /etc/rc.status: -# rc_check check and set local and overall rc status -# rc_status check and set local and overall rc status -# rc_status -v ditto but be verbose in local rc status -# rc_status -v -r ditto and clear the local rc status -# rc_status -s display "skipped" and exit with status 3 -# rc_status -u display "unused" and exit with status 3 -# rc_failed set local and overall rc status to failed -# rc_failed <num> set local and overall rc status to <num> -# rc_reset clear local rc status (overall remains) -# rc_exit exit appropriate to overall rc status -# rc_active checks whether a service is activated by symlinks -# rc_splash arg sets the boot splash screen to arg (if active) . /etc/rc.status -# Reset status of this service -rc_reset - -# Return values acc. to LSB for all commands but status: -# 0 - success -# 1 - generic or unspecified error -# 2 - invalid or excess argument(s) -# 3 - unimplemented feature (e.g. "reload") -# 4 - user had insufficient privileges -# 5 - program is not installed -# 6 - program is not configured -# 7 - program is not running -# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl) -# -# Note that starting an already running service, stopping -# or restarting a not-running service as well as the restart -# with force-reload (in case signaling is not supported) are -# considered a success. - -RETVAL=0 - start() { - echo -n $"Starting up sensors: " + echo -n "Starting up sensors" + unset ${!MODULE_*} test -r "$CONFIG" && . "$CONFIG" - modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '` - i=0 - while [ $i -lt $modules ] ; do - module=`eval echo '$'MODULE_$i` - echo starting module __${module}__ + for i in ${!MODULE_*} ; do + eval module=\$$i /sbin/modprobe $module &>/dev/null - i=`expr $i + 1` + rc_status done - $PSENSORS -s + rc_status - RETVAL=$? - if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lm_sensors ; then - rc_status -v + /usr/bin/sensors -s &> /dev/null + rc_status + + # Start fan control, if configured + if test -s "$FANCONFIG" -a -x "$PFAN" ; then + echo -n ", starting fan control: " + /sbin/startproc -q "$PFAN" + rc_status else - rc_status -v + echo -n ": " fi + + rc_status -v && touch /var/lock/subsys/sensors } stop() { - echo -n $"Shutting down sensors: " + echo -n "Shutting down sensors" + unset ${!MODULE_*} test -r "$CONFIG" && . "$CONFIG" - modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '` - i=`expr $modules` - while [ $i -ge 0 ] ; do - module=`eval echo '$'MODULE_$i` + # Stop fan control, if it was started + if test -s /var/run/fancontrol.pid ; then + echo -n ", stopping fan control: " + /sbin/killproc -TERM "$PFAN" + rc_status + else + echo -n ": " + fi + + for i in ${!MODULE_*} ; do + eval module=\$$i /sbin/modprobe -r $module &>/dev/null - i=`expr $i - 1` + rc_status done - /sbin/modprobe -r i2c-proc &>/dev/null - RETVAL=$? - if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lm_sensors ; then - rc_status -v - else - rc_status -v - fi + rc_status -v && rm -f /var/lock/subsys/sensors } dostatus() { - $PSENSORS - RETVAL=$? + $PSENSORS + rc_status } restart() { stop start - RETVAL=$? + rc_status } condrestart() { [ -e /var/lock/subsys/lm_sensors ] && restart || : } +# Reset status of this service +rc_reset + # See how we were called. case "$1" in start) @@ -163,12 +135,12 @@ case "$1" in restart|reload) restart ;; - condrestart) + try-restart) condrestart ;; *) - echo "Usage: sensors.init {start|stop|status|restart|reload|condrestart}" + echo "Usage: lm_sensors {start|stop|status|restart|reload|try-restart}" exit 1 esac -exit $RETVAL +rc_exit