[arch-commits] Commit in lm_sensors/repos (26 files)

Dave Reisner dreisner at archlinux.org
Sat Jun 16 17:15:28 UTC 2012


    Date: Saturday, June 16, 2012 @ 13:15:28
  Author: dreisner
Revision: 161931

db-move: moved lm_sensors from [staging] to [testing] ( i686,  x86_64)

Added:
  lm_sensors/repos/testing-i686/
  lm_sensors/repos/testing-i686/PKGBUILD
    (from rev 161923, lm_sensors/repos/staging-i686/PKGBUILD)
  lm_sensors/repos/testing-i686/daemonarg.patch
    (from rev 161923, lm_sensors/repos/staging-i686/daemonarg.patch)
  lm_sensors/repos/testing-i686/fancontrol.rc
    (from rev 161923, lm_sensors/repos/staging-i686/fancontrol.rc)
  lm_sensors/repos/testing-i686/fancontrol.service
    (from rev 161923, lm_sensors/repos/staging-i686/fancontrol.service)
  lm_sensors/repos/testing-i686/healthd
    (from rev 161923, lm_sensors/repos/staging-i686/healthd)
  lm_sensors/repos/testing-i686/healthd.conf
    (from rev 161923, lm_sensors/repos/staging-i686/healthd.conf)
  lm_sensors/repos/testing-i686/healthd.rc
    (from rev 161923, lm_sensors/repos/staging-i686/healthd.rc)
  lm_sensors/repos/testing-i686/linux_3.0.patch
    (from rev 161923, lm_sensors/repos/staging-i686/linux_3.0.patch)
  lm_sensors/repos/testing-i686/sensord.conf
    (from rev 161923, lm_sensors/repos/staging-i686/sensord.conf)
  lm_sensors/repos/testing-i686/sensord.rc
    (from rev 161923, lm_sensors/repos/staging-i686/sensord.rc)
  lm_sensors/repos/testing-i686/sensors.rc
    (from rev 161923, lm_sensors/repos/staging-i686/sensors.rc)
  lm_sensors/repos/testing-x86_64/
  lm_sensors/repos/testing-x86_64/PKGBUILD
    (from rev 161923, lm_sensors/repos/staging-x86_64/PKGBUILD)
  lm_sensors/repos/testing-x86_64/daemonarg.patch
    (from rev 161923, lm_sensors/repos/staging-x86_64/daemonarg.patch)
  lm_sensors/repos/testing-x86_64/fancontrol.rc
    (from rev 161923, lm_sensors/repos/staging-x86_64/fancontrol.rc)
  lm_sensors/repos/testing-x86_64/fancontrol.service
    (from rev 161923, lm_sensors/repos/staging-x86_64/fancontrol.service)
  lm_sensors/repos/testing-x86_64/healthd
    (from rev 161923, lm_sensors/repos/staging-x86_64/healthd)
  lm_sensors/repos/testing-x86_64/healthd.conf
    (from rev 161923, lm_sensors/repos/staging-x86_64/healthd.conf)
  lm_sensors/repos/testing-x86_64/healthd.rc
    (from rev 161923, lm_sensors/repos/staging-x86_64/healthd.rc)
  lm_sensors/repos/testing-x86_64/linux_3.0.patch
    (from rev 161923, lm_sensors/repos/staging-x86_64/linux_3.0.patch)
  lm_sensors/repos/testing-x86_64/sensord.conf
    (from rev 161923, lm_sensors/repos/staging-x86_64/sensord.conf)
  lm_sensors/repos/testing-x86_64/sensord.rc
    (from rev 161923, lm_sensors/repos/staging-x86_64/sensord.rc)
  lm_sensors/repos/testing-x86_64/sensors.rc
    (from rev 161923, lm_sensors/repos/staging-x86_64/sensors.rc)
Deleted:
  lm_sensors/repos/staging-i686/
  lm_sensors/repos/staging-x86_64/

-----------------------------------+
 testing-i686/PKGBUILD             |   55 ++++++++++++++++
 testing-i686/daemonarg.patch      |   50 +++++++++++++++
 testing-i686/fancontrol.rc        |   35 ++++++++++
 testing-i686/fancontrol.service   |    9 ++
 testing-i686/healthd              |   46 +++++++++++++
 testing-i686/healthd.conf         |   17 +++++
 testing-i686/healthd.rc           |   52 +++++++++++++++
 testing-i686/linux_3.0.patch      |   11 +++
 testing-i686/sensord.conf         |    4 +
 testing-i686/sensord.rc           |   37 +++++++++++
 testing-i686/sensors.rc           |  119 ++++++++++++++++++++++++++++++++++++
 testing-x86_64/PKGBUILD           |   55 ++++++++++++++++
 testing-x86_64/daemonarg.patch    |   50 +++++++++++++++
 testing-x86_64/fancontrol.rc      |   35 ++++++++++
 testing-x86_64/fancontrol.service |    9 ++
 testing-x86_64/healthd            |   46 +++++++++++++
 testing-x86_64/healthd.conf       |   17 +++++
 testing-x86_64/healthd.rc         |   52 +++++++++++++++
 testing-x86_64/linux_3.0.patch    |   11 +++
 testing-x86_64/sensord.conf       |    4 +
 testing-x86_64/sensord.rc         |   37 +++++++++++
 testing-x86_64/sensors.rc         |  119 ++++++++++++++++++++++++++++++++++++
 22 files changed, 870 insertions(+)

Copied: lm_sensors/repos/testing-i686/PKGBUILD (from rev 161923, lm_sensors/repos/staging-i686/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD	                        (rev 0)
+++ testing-i686/PKGBUILD	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,55 @@
+# $Id$
+# Maintainer: Eric Bélanger <eric at archlinux.org>
+
+pkgname=lm_sensors
+pkgver=3.3.2
+pkgrel=3
+pkgdesc="Collection of user space tools for general SMBus access and hardware monitoring"
+arch=('i686' 'x86_64')
+url="http://www.lm-sensors.org/"
+license=('GPL' 'LGPL')
+depends=('perl' 'sysfsutils')
+makedepends=('rrdtool')
+optdepends=('rrdtool: for logging with sensord')
+backup=('etc/sensors3.conf' 'etc/conf.d/healthd' 'etc/conf.d/sensord')
+options=('!emptydirs')
+source=(http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${pkgver}.tar.bz2{,.sig} \
+	sensors.rc fancontrol.rc healthd healthd.conf healthd.rc sensord.conf \
+        sensord.rc fancontrol.service daemonarg.patch linux_3.0.patch)
+sha1sums=('5d0f026ad763124e8c2ad733b6e1ad5e6473993d'
+          'a486d9fb6c5b0aff4520f6312106c67f5163f1cf'
+          'b2e664b9b87759991f02d0a1e8cac5e95098c0a5'
+          'a068ac0a3115a6191a487e11422506baa922b40a'
+          '78b5cd36c3cb8e98b972cdd8c4a12687d79a79a8'
+          '6c4e8a2d89dd2fd3ca2f0f4f3b1230111e01b0fc'
+          'e662881f5d3f3f35a1bc97ba45d2c471dd28c37f'
+          'de8d4d65406815c389f8a04e2a8508a1ae6749c8'
+          '72a60251d1d55a67307dab4105d9f3f01a080af4'
+          '7a4a4d1442aeeba0ba8aefb742a3ef187b593f4c'
+          '34241388c4001bfb6e49b7e10da1217e29a258d6'
+          '5662828085cdd981f0dc7cf8f79d3d6e2b72f50c')
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  sed -i -e 's|/etc/sysconfig|/etc/conf.d|' \
+         -e 's|/etc/init.d/lm_sensors|/etc/rc.d/sensors|' prog/{detect/sensors-detect,init/lm_sensors.service}
+  sed -i 's@\(/bin/systemctl\|/lib/systemd/system\)@/usr\1 at g' prog/detect/sensors-detect
+  patch -p1 < ../daemonarg.patch
+  patch -p0 < ../linux_3.0.patch
+  make PREFIX=/usr
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  make PROG_EXTRA=sensord BUILD_STATIC_LIB=0 \
+    PREFIX=/usr MANDIR=/usr/share/man DESTDIR="${pkgdir}" install
+  install -D -m644 prog/init/lm_sensors.service "${pkgdir}/usr/lib/systemd/system/lm_sensors.service"
+  install -D -m755 "${srcdir}/sensors.rc" "${pkgdir}/etc/rc.d/sensors"
+  install -D -m755 "${srcdir}/fancontrol.rc" "${pkgdir}/etc/rc.d/fancontrol"
+  install -D -m755 "${srcdir}/healthd" "${pkgdir}/usr/sbin/healthd"
+  install -D -m755 "${srcdir}/healthd.rc" "${pkgdir}/etc/rc.d/healthd"
+  install -D -m644 "${srcdir}/healthd.conf" "${pkgdir}/etc/conf.d/healthd"
+  install -D -m755 "${srcdir}/sensord.rc" "${pkgdir}/etc/rc.d/sensord"
+  install -D -m644 "${srcdir}/sensord.conf" "${pkgdir}/etc/conf.d/sensord"
+  install -D -m644 "${srcdir}/fancontrol.service" "${pkgdir}/usr/lib/systemd/system/fancontrol.service"
+}

Copied: lm_sensors/repos/testing-i686/daemonarg.patch (from rev 161923, lm_sensors/repos/staging-i686/daemonarg.patch)
===================================================================
--- testing-i686/daemonarg.patch	                        (rev 0)
+++ testing-i686/daemonarg.patch	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,50 @@
+diff -ru lm_sensors-3.1.2-1/prog/pwm/fancontrol lm_sensors-3.1.2-1_pyropeter/usr/sbin/fancontrol
+--- lm_sensors-3.1.2-1/prog/pwm/fancontrol	2010-02-03 03:45:15.000000000 +0100
++++ lm_sensors-3.1.2-1_pyropeter/prog/pwm/fancontrol	2010-03-07 01:37:09.000000000 +0100
+@@ -5,7 +5,9 @@
+ #
+ # Version 0.70
+ #
+-# Usage: fancontrol [CONFIGFILE]
++# Usage: fancontrol [-D] [CONFIGFILE]
++#
++# (-D causes fancontrol to 'fork' to the background after some tests)
+ #
+ # Dependencies:
+ #   bash, egrep, sed, cut, sleep, readlink, lm_sensors :)
+@@ -43,6 +45,12 @@
+ #DEBUG=1
+ MAX=255
+ 
++DAEMON=0
++if [ "$1" = "-D" ]; then
++	DAEMON=1
++	shift
++fi
++
+ declare -i pwmval
+ 
+ function LoadConfig {
+@@ -303,7 +311,6 @@
+ 	echo "File $PIDFILE exists, is fancontrol already running?"
+ 	exit 1
+ fi
+-echo $$ > "$PIDFILE"
+ 
+ # $1 = pwm file name
+ function pwmdisable()
+@@ -475,6 +482,14 @@
+ 	let fcvcount=$fcvcount+1
+ done
+ 
++if [ "$DAEMON" -gt 0 ]; then
++	echo "Forking..."
++	$0 $* &> /dev/null &
++	exit 0
++fi
++
++echo $$ > "$PIDFILE"
++
+ echo 'Starting automatic fan control...'
+ 
+ # main loop calling the main function at specified intervals

Copied: lm_sensors/repos/testing-i686/fancontrol.rc (from rev 161923, lm_sensors/repos/staging-i686/fancontrol.rc)
===================================================================
--- testing-i686/fancontrol.rc	                        (rev 0)
+++ testing-i686/fancontrol.rc	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID -x /usr/sbin/fancontrol)
+case "$1" in
+  start)
+    stat_busy "Starting fancontrol"
+    [ -z "$PID" ] && /usr/sbin/fancontrol -D &>/dev/null
+    if [ $? -gt 0 -o -n "$PID" ]; then
+      stat_fail
+    else
+      add_daemon fancontrol
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping fancontrol"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon fancontrol
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac
+exit 0

Copied: lm_sensors/repos/testing-i686/fancontrol.service (from rev 161923, lm_sensors/repos/staging-i686/fancontrol.service)
===================================================================
--- testing-i686/fancontrol.service	                        (rev 0)
+++ testing-i686/fancontrol.service	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,9 @@
+[Unit]
+Description=Fan control daemon
+
+[Service]
+PIDFile=/var/run/fancontrol.pid
+ExecStart=/usr/sbin/fancontrol
+
+[Install]
+WantedBy=multi-user.target

Copied: lm_sensors/repos/testing-i686/healthd (from rev 161923, lm_sensors/repos/staging-i686/healthd)
===================================================================
--- testing-i686/healthd	                        (rev 0)
+++ testing-i686/healthd	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+#
+# /usr/sbin/healthd
+#
+
+. /etc/conf.d/healthd
+
+cmd="${ALARM_CMD}"
+addr="${ADMIN_EMAIL}"
+slp="${ALARM_SLEEP}"
+sensors="/usr/bin/sensors"
+
+
+while [ $# -gt 0 ] ; do
+	case "${1}" in
+		-c ) cmd="${2}" ; shift 2 ;;
+		-m ) addr="${2}" ; shift 2 ;;
+		-s ) slp="${2}" ; shift 2 ;;
+		*  ) shift 1 ;;
+	esac
+done
+
+[ -n "${cmd}" ] && [ -n "$( which -- "${cmd%% *}" )" ] || \
+	[ -n "${addr}" ] || exit 1
+
+[ "${slp}" -ge 2 ] || slp=600
+
+while true ; do
+	sleep 15
+	message="$( $sensors )"
+	case "$message" in
+		''      ) message='Could not get any sensor values !' ;;
+		*ALARM* ) : ;;
+		*       ) message='' ;;
+	esac
+	if [ -n "$message" ]; then
+		if [ -n "${addr}" ]; then
+			echo "$message" | mail -s \
+				"Sensors ALARM detected at host: $( hostname )" \
+				"${addr}"
+		fi
+		[ -z "${cmd}" ] || ${cmd} &
+		sleep ${slp}
+	fi
+done &

Copied: lm_sensors/repos/testing-i686/healthd.conf (from rev 161923, lm_sensors/repos/staging-i686/healthd.conf)
===================================================================
--- testing-i686/healthd.conf	                        (rev 0)
+++ testing-i686/healthd.conf	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,17 @@
+#
+# /etc/conf.d/healthd
+#
+
+# reset any pending alarms on startup
+ALARM_RESET="yes"
+
+# where to sent mails on alarm
+ADMIN_EMAIL="root"
+
+# Seconds to sleep when alarm detected before checking again
+# If you want to fill up your mail inbox set this to 2. ;-)
+ALARM_SLEEP=600
+
+# command to run in background on each alarm
+# N.B.: If you choose to use the beep command, you'll need to install it: pacman -S beep
+ALARM_CMD="beep -f 800 -l 500 -d 500 -r 600"

Copied: lm_sensors/repos/testing-i686/healthd.rc (from rev 161923, lm_sensors/repos/staging-i686/healthd.rc)
===================================================================
--- testing-i686/healthd.rc	                        (rev 0)
+++ testing-i686/healthd.rc	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+#
+# /etc/rc.d/healthd
+#
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/healthd
+
+maybe_alarm_reset() {
+  case "${ALARM_RESET}" in
+    yes) /usr/bin/sensors > /dev/null
+    ;;
+    no) true
+    ;;
+    *) false
+    esac
+  return $?
+}
+
+PID=$(pidof -x -o %PPID /usr/sbin/healthd)
+case "${1}" in
+  start)
+    stat_busy "Starting Health Daemon"
+    [ -z "${PID}" ] && maybe_alarm_reset && /usr/sbin/healthd &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      echo "${PID}" > /var/run/healthd.pid
+      add_daemon healthd
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping Health Daemon"
+    [ ! -z "${PID}" ] && kill ${PID} &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon healthd
+      stat_done
+    fi
+    ;;
+  restart) 
+    $0 stop 
+    sleep 2
+    $0 start 
+    ;;
+  *) echo "usage: $0 {start|stop|restart}"
+esac
+exit 0

Copied: lm_sensors/repos/testing-i686/linux_3.0.patch (from rev 161923, lm_sensors/repos/staging-i686/linux_3.0.patch)
===================================================================
--- testing-i686/linux_3.0.patch	                        (rev 0)
+++ testing-i686/linux_3.0.patch	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,11 @@
+--- prog/detect/sensors-detect	2011-08-02 10:23:46.000000000 +0200
++++ prog/detect/sensors-detect	2011-08-02 10:24:04.000000000 +0200
+@@ -2472,7 +2472,7 @@
+ 
+ sub initialize_kernel_version
+ {
+-	`uname -r` =~ /(\d+)\.(\d+)\.(\d+)(.*)/;
++	`uname -r` =~ /(\d+)\.(\d+)(.*)/;
+ 	@kernel_version = ($1, $2, $3, $4);
+ 	chomp($kernel_arch = `uname -m`);
+ 

Copied: lm_sensors/repos/testing-i686/sensord.conf (from rev 161923, lm_sensors/repos/staging-i686/sensord.conf)
===================================================================
--- testing-i686/sensord.conf	                        (rev 0)
+++ testing-i686/sensord.conf	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,4 @@
+#
+# Parameters to be passed to sensord
+#
+SENSORD_ARGS=""

Copied: lm_sensors/repos/testing-i686/sensord.rc (from rev 161923, lm_sensors/repos/staging-i686/sensord.rc)
===================================================================
--- testing-i686/sensord.rc	                        (rev 0)
+++ testing-i686/sensord.rc	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/sensord
+
+PID=$(pidof -o %PPID /usr/sbin/sensord)
+case "$1" in
+  start)
+    stat_busy "Starting sensord"
+    [ -z "$PID" ] && /usr/sbin/sensord ${SENSORD_ARGS}
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon sensord
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping sensord"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon sensord
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac
+exit 0

Copied: lm_sensors/repos/testing-i686/sensors.rc (from rev 161923, lm_sensors/repos/staging-i686/sensors.rc)
===================================================================
--- testing-i686/sensors.rc	                        (rev 0)
+++ testing-i686/sensors.rc	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,119 @@
+#!/bin/bash
+
+# description: sensors is used for monitoring motherboard sensor values.
+# config: /etc/conf.d/lm_sensors
+
+# See also the lm_sensors homepage at:
+#     http://www2.lm-sensors.nu/~lm78/index.html
+
+# It uses a config file /etc/conf.d/lm_sensors that contains the modules to
+# be loaded/unloaded. That file is sourced into this one.
+
+# The format of that file a shell script that simply defines the modules
+# in order as normal shell variables with the special names:
+#    MODULE_1, MODULE_2, MODULE_3, etc.
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PSENSORS=/usr/bin/sensors
+
+if $(grep -q sysfs /proc/mounts); then
+  WITHSYS=1
+else
+  WITHSYS=0
+fi
+
+if [ $WITHSYS == "0" ]; then
+  # If sensors isn't supported by the kernel, try loading the module...
+  [ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc &>/dev/null
+
+  # Don't bother if /proc/sensors still doesn't exist, kernel doesn't have support for sensors.
+  if ! [ -e /proc/sys/dev/sensors ]; then
+    echo  "lm_sensors: kernel does not have sensors support"
+    stat_fail
+  fi
+
+  # If sensors was not already running, unload the module...
+  [ -e /var/run/daemons/sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null
+fi
+
+if [ -e /etc/conf.d/lm_sensors ]; then
+  CONFIG=/etc/conf.d/lm_sensors
+elif [ -e /etc/sysconfig/lm_sensors ]; then
+  # Moving config to new Arch-specific location
+  mv /etc/sysconfig/lm_sensors /etc/conf.d/lm_sensors
+  CONFIG=/etc/conf.d/lm_sensors
+fi
+
+case "$1" in
+  start)
+    stat_busy "Starting Up Sensors"
+
+    if [ -r "$CONFIG" ]; then
+      . "$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}__ #debug
+        /sbin/modprobe $module &>/dev/null
+        i=$(expr $i + 1)
+      done
+    fi
+
+    $PSENSORS -s
+
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon sensors
+      stat_done
+    fi	  
+    ;;
+
+  stop)
+    stat_busy "Shutting Down Sensors"
+
+    if [ -r "$CONFIG" ]; then
+      . "$CONFIG"
+      modules=$(grep \^MODULE_ $CONFIG | wc -l | tr -d ' ')
+      i=$(expr $modules - 1)
+      while [ $i -ge 0 ] ; do
+        module=$(eval echo '$'MODULE_$i)
+      #  echo stoping module __${module}__ #debug
+        /sbin/modprobe -r $module &>/dev/null
+        i=$(expr $i - 1)
+      done
+    fi
+
+    if [ $WITHSYS == "0" ]; then
+      /sbin/modprobe -r i2c-proc &>/dev/null
+    fi
+
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon sensors
+      stat_done
+    fi
+    ;;
+    
+  status)
+    $PSENSORS
+    ;;
+    
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+
+  condrestart)
+    [ -e /var/run/daemons/sensors ] && $0 restart || :
+    ;;
+
+  *)
+    echo "Usage: $0 {start|stop|restart|status|condrestart}"
+esac
+exit 0

Copied: lm_sensors/repos/testing-x86_64/PKGBUILD (from rev 161923, lm_sensors/repos/staging-x86_64/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,55 @@
+# $Id$
+# Maintainer: Eric Bélanger <eric at archlinux.org>
+
+pkgname=lm_sensors
+pkgver=3.3.2
+pkgrel=3
+pkgdesc="Collection of user space tools for general SMBus access and hardware monitoring"
+arch=('i686' 'x86_64')
+url="http://www.lm-sensors.org/"
+license=('GPL' 'LGPL')
+depends=('perl' 'sysfsutils')
+makedepends=('rrdtool')
+optdepends=('rrdtool: for logging with sensord')
+backup=('etc/sensors3.conf' 'etc/conf.d/healthd' 'etc/conf.d/sensord')
+options=('!emptydirs')
+source=(http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${pkgver}.tar.bz2{,.sig} \
+	sensors.rc fancontrol.rc healthd healthd.conf healthd.rc sensord.conf \
+        sensord.rc fancontrol.service daemonarg.patch linux_3.0.patch)
+sha1sums=('5d0f026ad763124e8c2ad733b6e1ad5e6473993d'
+          'a486d9fb6c5b0aff4520f6312106c67f5163f1cf'
+          'b2e664b9b87759991f02d0a1e8cac5e95098c0a5'
+          'a068ac0a3115a6191a487e11422506baa922b40a'
+          '78b5cd36c3cb8e98b972cdd8c4a12687d79a79a8'
+          '6c4e8a2d89dd2fd3ca2f0f4f3b1230111e01b0fc'
+          'e662881f5d3f3f35a1bc97ba45d2c471dd28c37f'
+          'de8d4d65406815c389f8a04e2a8508a1ae6749c8'
+          '72a60251d1d55a67307dab4105d9f3f01a080af4'
+          '7a4a4d1442aeeba0ba8aefb742a3ef187b593f4c'
+          '34241388c4001bfb6e49b7e10da1217e29a258d6'
+          '5662828085cdd981f0dc7cf8f79d3d6e2b72f50c')
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  sed -i -e 's|/etc/sysconfig|/etc/conf.d|' \
+         -e 's|/etc/init.d/lm_sensors|/etc/rc.d/sensors|' prog/{detect/sensors-detect,init/lm_sensors.service}
+  sed -i 's@\(/bin/systemctl\|/lib/systemd/system\)@/usr\1 at g' prog/detect/sensors-detect
+  patch -p1 < ../daemonarg.patch
+  patch -p0 < ../linux_3.0.patch
+  make PREFIX=/usr
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  make PROG_EXTRA=sensord BUILD_STATIC_LIB=0 \
+    PREFIX=/usr MANDIR=/usr/share/man DESTDIR="${pkgdir}" install
+  install -D -m644 prog/init/lm_sensors.service "${pkgdir}/usr/lib/systemd/system/lm_sensors.service"
+  install -D -m755 "${srcdir}/sensors.rc" "${pkgdir}/etc/rc.d/sensors"
+  install -D -m755 "${srcdir}/fancontrol.rc" "${pkgdir}/etc/rc.d/fancontrol"
+  install -D -m755 "${srcdir}/healthd" "${pkgdir}/usr/sbin/healthd"
+  install -D -m755 "${srcdir}/healthd.rc" "${pkgdir}/etc/rc.d/healthd"
+  install -D -m644 "${srcdir}/healthd.conf" "${pkgdir}/etc/conf.d/healthd"
+  install -D -m755 "${srcdir}/sensord.rc" "${pkgdir}/etc/rc.d/sensord"
+  install -D -m644 "${srcdir}/sensord.conf" "${pkgdir}/etc/conf.d/sensord"
+  install -D -m644 "${srcdir}/fancontrol.service" "${pkgdir}/usr/lib/systemd/system/fancontrol.service"
+}

Copied: lm_sensors/repos/testing-x86_64/daemonarg.patch (from rev 161923, lm_sensors/repos/staging-x86_64/daemonarg.patch)
===================================================================
--- testing-x86_64/daemonarg.patch	                        (rev 0)
+++ testing-x86_64/daemonarg.patch	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,50 @@
+diff -ru lm_sensors-3.1.2-1/prog/pwm/fancontrol lm_sensors-3.1.2-1_pyropeter/usr/sbin/fancontrol
+--- lm_sensors-3.1.2-1/prog/pwm/fancontrol	2010-02-03 03:45:15.000000000 +0100
++++ lm_sensors-3.1.2-1_pyropeter/prog/pwm/fancontrol	2010-03-07 01:37:09.000000000 +0100
+@@ -5,7 +5,9 @@
+ #
+ # Version 0.70
+ #
+-# Usage: fancontrol [CONFIGFILE]
++# Usage: fancontrol [-D] [CONFIGFILE]
++#
++# (-D causes fancontrol to 'fork' to the background after some tests)
+ #
+ # Dependencies:
+ #   bash, egrep, sed, cut, sleep, readlink, lm_sensors :)
+@@ -43,6 +45,12 @@
+ #DEBUG=1
+ MAX=255
+ 
++DAEMON=0
++if [ "$1" = "-D" ]; then
++	DAEMON=1
++	shift
++fi
++
+ declare -i pwmval
+ 
+ function LoadConfig {
+@@ -303,7 +311,6 @@
+ 	echo "File $PIDFILE exists, is fancontrol already running?"
+ 	exit 1
+ fi
+-echo $$ > "$PIDFILE"
+ 
+ # $1 = pwm file name
+ function pwmdisable()
+@@ -475,6 +482,14 @@
+ 	let fcvcount=$fcvcount+1
+ done
+ 
++if [ "$DAEMON" -gt 0 ]; then
++	echo "Forking..."
++	$0 $* &> /dev/null &
++	exit 0
++fi
++
++echo $$ > "$PIDFILE"
++
+ echo 'Starting automatic fan control...'
+ 
+ # main loop calling the main function at specified intervals

Copied: lm_sensors/repos/testing-x86_64/fancontrol.rc (from rev 161923, lm_sensors/repos/staging-x86_64/fancontrol.rc)
===================================================================
--- testing-x86_64/fancontrol.rc	                        (rev 0)
+++ testing-x86_64/fancontrol.rc	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=$(pidof -o %PPID -x /usr/sbin/fancontrol)
+case "$1" in
+  start)
+    stat_busy "Starting fancontrol"
+    [ -z "$PID" ] && /usr/sbin/fancontrol -D &>/dev/null
+    if [ $? -gt 0 -o -n "$PID" ]; then
+      stat_fail
+    else
+      add_daemon fancontrol
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping fancontrol"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon fancontrol
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac
+exit 0

Copied: lm_sensors/repos/testing-x86_64/fancontrol.service (from rev 161923, lm_sensors/repos/staging-x86_64/fancontrol.service)
===================================================================
--- testing-x86_64/fancontrol.service	                        (rev 0)
+++ testing-x86_64/fancontrol.service	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,9 @@
+[Unit]
+Description=Fan control daemon
+
+[Service]
+PIDFile=/var/run/fancontrol.pid
+ExecStart=/usr/sbin/fancontrol
+
+[Install]
+WantedBy=multi-user.target

Copied: lm_sensors/repos/testing-x86_64/healthd (from rev 161923, lm_sensors/repos/staging-x86_64/healthd)
===================================================================
--- testing-x86_64/healthd	                        (rev 0)
+++ testing-x86_64/healthd	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+#
+# /usr/sbin/healthd
+#
+
+. /etc/conf.d/healthd
+
+cmd="${ALARM_CMD}"
+addr="${ADMIN_EMAIL}"
+slp="${ALARM_SLEEP}"
+sensors="/usr/bin/sensors"
+
+
+while [ $# -gt 0 ] ; do
+	case "${1}" in
+		-c ) cmd="${2}" ; shift 2 ;;
+		-m ) addr="${2}" ; shift 2 ;;
+		-s ) slp="${2}" ; shift 2 ;;
+		*  ) shift 1 ;;
+	esac
+done
+
+[ -n "${cmd}" ] && [ -n "$( which -- "${cmd%% *}" )" ] || \
+	[ -n "${addr}" ] || exit 1
+
+[ "${slp}" -ge 2 ] || slp=600
+
+while true ; do
+	sleep 15
+	message="$( $sensors )"
+	case "$message" in
+		''      ) message='Could not get any sensor values !' ;;
+		*ALARM* ) : ;;
+		*       ) message='' ;;
+	esac
+	if [ -n "$message" ]; then
+		if [ -n "${addr}" ]; then
+			echo "$message" | mail -s \
+				"Sensors ALARM detected at host: $( hostname )" \
+				"${addr}"
+		fi
+		[ -z "${cmd}" ] || ${cmd} &
+		sleep ${slp}
+	fi
+done &

Copied: lm_sensors/repos/testing-x86_64/healthd.conf (from rev 161923, lm_sensors/repos/staging-x86_64/healthd.conf)
===================================================================
--- testing-x86_64/healthd.conf	                        (rev 0)
+++ testing-x86_64/healthd.conf	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,17 @@
+#
+# /etc/conf.d/healthd
+#
+
+# reset any pending alarms on startup
+ALARM_RESET="yes"
+
+# where to sent mails on alarm
+ADMIN_EMAIL="root"
+
+# Seconds to sleep when alarm detected before checking again
+# If you want to fill up your mail inbox set this to 2. ;-)
+ALARM_SLEEP=600
+
+# command to run in background on each alarm
+# N.B.: If you choose to use the beep command, you'll need to install it: pacman -S beep
+ALARM_CMD="beep -f 800 -l 500 -d 500 -r 600"

Copied: lm_sensors/repos/testing-x86_64/healthd.rc (from rev 161923, lm_sensors/repos/staging-x86_64/healthd.rc)
===================================================================
--- testing-x86_64/healthd.rc	                        (rev 0)
+++ testing-x86_64/healthd.rc	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+#
+# /etc/rc.d/healthd
+#
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/healthd
+
+maybe_alarm_reset() {
+  case "${ALARM_RESET}" in
+    yes) /usr/bin/sensors > /dev/null
+    ;;
+    no) true
+    ;;
+    *) false
+    esac
+  return $?
+}
+
+PID=$(pidof -x -o %PPID /usr/sbin/healthd)
+case "${1}" in
+  start)
+    stat_busy "Starting Health Daemon"
+    [ -z "${PID}" ] && maybe_alarm_reset && /usr/sbin/healthd &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      echo "${PID}" > /var/run/healthd.pid
+      add_daemon healthd
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping Health Daemon"
+    [ ! -z "${PID}" ] && kill ${PID} &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon healthd
+      stat_done
+    fi
+    ;;
+  restart) 
+    $0 stop 
+    sleep 2
+    $0 start 
+    ;;
+  *) echo "usage: $0 {start|stop|restart}"
+esac
+exit 0

Copied: lm_sensors/repos/testing-x86_64/linux_3.0.patch (from rev 161923, lm_sensors/repos/staging-x86_64/linux_3.0.patch)
===================================================================
--- testing-x86_64/linux_3.0.patch	                        (rev 0)
+++ testing-x86_64/linux_3.0.patch	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,11 @@
+--- prog/detect/sensors-detect	2011-08-02 10:23:46.000000000 +0200
++++ prog/detect/sensors-detect	2011-08-02 10:24:04.000000000 +0200
+@@ -2472,7 +2472,7 @@
+ 
+ sub initialize_kernel_version
+ {
+-	`uname -r` =~ /(\d+)\.(\d+)\.(\d+)(.*)/;
++	`uname -r` =~ /(\d+)\.(\d+)(.*)/;
+ 	@kernel_version = ($1, $2, $3, $4);
+ 	chomp($kernel_arch = `uname -m`);
+ 

Copied: lm_sensors/repos/testing-x86_64/sensord.conf (from rev 161923, lm_sensors/repos/staging-x86_64/sensord.conf)
===================================================================
--- testing-x86_64/sensord.conf	                        (rev 0)
+++ testing-x86_64/sensord.conf	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,4 @@
+#
+# Parameters to be passed to sensord
+#
+SENSORD_ARGS=""

Copied: lm_sensors/repos/testing-x86_64/sensord.rc (from rev 161923, lm_sensors/repos/staging-x86_64/sensord.rc)
===================================================================
--- testing-x86_64/sensord.rc	                        (rev 0)
+++ testing-x86_64/sensord.rc	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/sensord
+
+PID=$(pidof -o %PPID /usr/sbin/sensord)
+case "$1" in
+  start)
+    stat_busy "Starting sensord"
+    [ -z "$PID" ] && /usr/sbin/sensord ${SENSORD_ARGS}
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon sensord
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping sensord"
+    [ ! -z "$PID" ]  && kill $PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon sensord
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"  
+esac
+exit 0

Copied: lm_sensors/repos/testing-x86_64/sensors.rc (from rev 161923, lm_sensors/repos/staging-x86_64/sensors.rc)
===================================================================
--- testing-x86_64/sensors.rc	                        (rev 0)
+++ testing-x86_64/sensors.rc	2012-06-16 17:15:28 UTC (rev 161931)
@@ -0,0 +1,119 @@
+#!/bin/bash
+
+# description: sensors is used for monitoring motherboard sensor values.
+# config: /etc/conf.d/lm_sensors
+
+# See also the lm_sensors homepage at:
+#     http://www2.lm-sensors.nu/~lm78/index.html
+
+# It uses a config file /etc/conf.d/lm_sensors that contains the modules to
+# be loaded/unloaded. That file is sourced into this one.
+
+# The format of that file a shell script that simply defines the modules
+# in order as normal shell variables with the special names:
+#    MODULE_1, MODULE_2, MODULE_3, etc.
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PSENSORS=/usr/bin/sensors
+
+if $(grep -q sysfs /proc/mounts); then
+  WITHSYS=1
+else
+  WITHSYS=0
+fi
+
+if [ $WITHSYS == "0" ]; then
+  # If sensors isn't supported by the kernel, try loading the module...
+  [ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc &>/dev/null
+
+  # Don't bother if /proc/sensors still doesn't exist, kernel doesn't have support for sensors.
+  if ! [ -e /proc/sys/dev/sensors ]; then
+    echo  "lm_sensors: kernel does not have sensors support"
+    stat_fail
+  fi
+
+  # If sensors was not already running, unload the module...
+  [ -e /var/run/daemons/sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null
+fi
+
+if [ -e /etc/conf.d/lm_sensors ]; then
+  CONFIG=/etc/conf.d/lm_sensors
+elif [ -e /etc/sysconfig/lm_sensors ]; then
+  # Moving config to new Arch-specific location
+  mv /etc/sysconfig/lm_sensors /etc/conf.d/lm_sensors
+  CONFIG=/etc/conf.d/lm_sensors
+fi
+
+case "$1" in
+  start)
+    stat_busy "Starting Up Sensors"
+
+    if [ -r "$CONFIG" ]; then
+      . "$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}__ #debug
+        /sbin/modprobe $module &>/dev/null
+        i=$(expr $i + 1)
+      done
+    fi
+
+    $PSENSORS -s
+
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      add_daemon sensors
+      stat_done
+    fi	  
+    ;;
+
+  stop)
+    stat_busy "Shutting Down Sensors"
+
+    if [ -r "$CONFIG" ]; then
+      . "$CONFIG"
+      modules=$(grep \^MODULE_ $CONFIG | wc -l | tr -d ' ')
+      i=$(expr $modules - 1)
+      while [ $i -ge 0 ] ; do
+        module=$(eval echo '$'MODULE_$i)
+      #  echo stoping module __${module}__ #debug
+        /sbin/modprobe -r $module &>/dev/null
+        i=$(expr $i - 1)
+      done
+    fi
+
+    if [ $WITHSYS == "0" ]; then
+      /sbin/modprobe -r i2c-proc &>/dev/null
+    fi
+
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm_daemon sensors
+      stat_done
+    fi
+    ;;
+    
+  status)
+    $PSENSORS
+    ;;
+    
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+
+  condrestart)
+    [ -e /var/run/daemons/sensors ] && $0 restart || :
+    ;;
+
+  *)
+    echo "Usage: $0 {start|stop|restart|status|condrestart}"
+esac
+exit 0




More information about the arch-commits mailing list