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

Eric Bélanger eric at archlinux.org
Thu Jun 25 03:06:40 UTC 2009


    Date: Wednesday, June 24, 2009 @ 23:06:40
  Author: eric
Revision: 43527

Merged revisions 43525 via svnmerge from 
svn+ssh://svn.archlinux.org/srv/svn-packages/lm_sensors/trunk

........
  r43525 | eric | 2009-06-24 22:35:52 -0400 (Wed, 24 Jun 2009) | 2 lines
  
  upgpkg: lm_sensors 3.1.1-1
      Upstream update, Added healthd daemon (close FS#14597)
........

Added:
  lm_sensors/repos/extra-i686/healthd
    (from rev 43525, lm_sensors/trunk/healthd)
  lm_sensors/repos/extra-i686/healthd.conf
    (from rev 43525, lm_sensors/trunk/healthd.conf)
  lm_sensors/repos/extra-i686/healthd.rc
    (from rev 43525, lm_sensors/trunk/healthd.rc)
Modified:
  lm_sensors/repos/extra-i686/	(properties)
  lm_sensors/repos/extra-i686/ChangeLog
  lm_sensors/repos/extra-i686/PKGBUILD

--------------+
 ChangeLog    |    6 ++++++
 PKGBUILD     |   38 ++++++++++++++++++++++----------------
 healthd      |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 healthd.conf |   16 ++++++++++++++++
 healthd.rc   |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 143 insertions(+), 16 deletions(-)


Property changes on: lm_sensors/repos/extra-i686
___________________________________________________________________
Modified: svnmerge-integrated
   - /lm_sensors/trunk:1-28980
   + /lm_sensors/trunk:1-43526

Modified: extra-i686/ChangeLog
===================================================================
--- extra-i686/ChangeLog	2009-06-25 02:36:38 UTC (rev 43526)
+++ extra-i686/ChangeLog	2009-06-25 03:06:40 UTC (rev 43527)
@@ -1,3 +1,9 @@
+2009-06-24  Eric Belanger  <eric at archlinux.org>
+
+	* lm_sensors 3.1.1-1
+	* Upstream update
+	* Added healthd daemon (close FS#14597)
+
 2009-03-03  Eric Belanger  <eric at archlinux.org>
 
 	* lm_sensors 3.1.0-1

Modified: extra-i686/PKGBUILD
===================================================================
--- extra-i686/PKGBUILD	2009-06-25 02:36:38 UTC (rev 43526)
+++ extra-i686/PKGBUILD	2009-06-25 03:06:40 UTC (rev 43527)
@@ -3,7 +3,7 @@
 # Contributor: Aurelien Foret <orelien at chez.com>
 
 pkgname=lm_sensors
-pkgver=3.1.0
+pkgver=3.1.1
 pkgrel=1
 pkgdesc="Collection of user space tools for general SMBus access and hardware monitoring."
 arch=('i686' 'x86_64')
@@ -15,28 +15,34 @@
 backup=('etc/sensors3.conf')
 install=sensors.install
 source=(http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${pkgver}.tar.bz2 \
-	sensors.rc fancontrol.rc sensors-detect.patch)
-md5sums=('e23130eaa46c66b861729835e08bdccf' 'c370f5e620bfe41113354a1e22c0c18c'\
-         'f14e335a8eea27388892c36af8099782' '47c40b381d1f25d6634ae84cecf35f33')
-sha1sums=('b36577ca07d3028910a93958e5809ba7b85e0bf8'
+	sensors.rc fancontrol.rc sensors-detect.patch healthd healthd.conf healthd.rc)
+md5sums=('613d7cfa23b70c0abae3fabb0a72ff5f' 'c370f5e620bfe41113354a1e22c0c18c'\
+         'f14e335a8eea27388892c36af8099782' '47c40b381d1f25d6634ae84cecf35f33'\
+         '6415014dc77365a48525901f30fe99da' 'f649261f52bd4329347bf93f5f83cb0a'\
+         '970408d2e509dc4138927020efefe323')
+sha1sums=('8be15806d229305491f11b77c67496074480faf4'
           'b2e664b9b87759991f02d0a1e8cac5e95098c0a5'
           '4a5c7b9114118f66e283a728d41b5fa7fe8b551d'
-          '47095a32a918d6be50bd8daa8aaa9c24940d60e9')
+          '47095a32a918d6be50bd8daa8aaa9c24940d60e9'
+          '06128ebb689aa271eef916e14ae1f2c42bee1f1d'
+          'c6ddfebc20685ba69700f66038c6b00a7c0bdb80'
+          'e662881f5d3f3f35a1bc97ba45d2c471dd28c37f')
 
 build() {
-  cd ${srcdir}/${pkgname}-${pkgver}
+  cd "${srcdir}/${pkgname}-${pkgver}"
   patch -p1 < ../sensors-detect.patch || return 1
 
-  make PREFIX=/usr PROG_EXTRA:=sensord user || return 1
-  make user_install PREFIX=/usr MANDIR=/usr/share/man DESTDIR=${pkgdir} || return 1
-  install -DT -m755 ${srcdir}/${pkgname}-${pkgver}/prog/sensord/sensord ${pkgdir}/usr/sbin/sensord || return 1
+  make PREFIX=/usr PROG_EXTRA:=sensord || return 1
+  make PREFIX=/usr MANDIR=/usr/share/man DESTDIR="${pkgdir}" install || return 1
 
-  install -DT -m755 ${srcdir}/sensors.rc ${pkgdir}/etc/rc.d/sensors || return 1
-  install -DT -m755 ${srcdir}/fancontrol.rc ${pkgdir}/etc/rc.d/fancontrol || return 1
+  install -D -m755 prog/sensord/sensord "${pkgdir}/usr/sbin/sensord" || return 1
+  install -D -m755 "${srcdir}/sensors.rc" "${pkgdir}/etc/rc.d/sensors" || return 1
+  install -D -m755 "${srcdir}/fancontrol.rc" "${pkgdir}/etc/rc.d/fancontrol" || return 1
+  install -D -m755 "${srcdir}/healthd" "${pkgdir}/usr/sbin/healthd" || return 1
+  install -D -m755 "${srcdir}/healthd.rc" "${pkgdir}/etc/rc.d/healthd" || return 1
+  install -D -m644 "${srcdir}/healthd.conf" "${pkgdir}/etc/conf.d/healthd" || return 1
 
   # remove the static lib
-  rm -rf ${pkgdir}/usr/lib/libsensors.a
-
-  # FIXME: avoid conflicts with glibc headers
-  rm -rf ${pkgdir}/usr/include/linux
+  rm -rf "${pkgdir}/usr/lib/libsensors.a"
+  rmdir "${pkgdir}/etc/sensors.d"
 }

Copied: lm_sensors/repos/extra-i686/healthd (from rev 43525, lm_sensors/trunk/healthd)
===================================================================
--- extra-i686/healthd	                        (rev 0)
+++ extra-i686/healthd	2009-06-25 03:06:40 UTC (rev 43527)
@@ -0,0 +1,47 @@
+#!/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}" ;;
+		-m ) addr="${2}" ;;
+		-s ) slp="${2}" ;;
+		*  ) return 1 ;;
+	esac
+	shift 2
+done
+
+[ -n "${cmd}" ] && [ -n "$( which -- "${cmd%% *}" )" ] || \
+	[ -n "${addr}" ] || return 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/extra-i686/healthd.conf (from rev 43525, lm_sensors/trunk/healthd.conf)
===================================================================
--- extra-i686/healthd.conf	                        (rev 0)
+++ extra-i686/healthd.conf	2009-06-25 03:06:40 UTC (rev 43527)
@@ -0,0 +1,16 @@
+#
+# /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
+ALARM_CMD="beep -f 800 -l 500 -d 500 -r 600"

Copied: lm_sensors/repos/extra-i686/healthd.rc (from rev 43525, lm_sensors/trunk/healthd.rc)
===================================================================
--- extra-i686/healthd.rc	                        (rev 0)
+++ extra-i686/healthd.rc	2009-06-25 03:06:40 UTC (rev 43527)
@@ -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




More information about the arch-commits mailing list