From 3de330643fe0e7e6b62fe1d4152659a8cd4b9330 Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Fri, 10 Jan 2014 14:46:42 +0100 Subject: [PATCH] - Enhancing the sensord service wrapper (#863986) - UsrMove and libexec path tunings --- lm_sensors-modprobe | 2 +- lm_sensors-modprobe-r | 2 +- lm_sensors.spec | 14 ++++++++++++-- sensord-service-wrapper | 2 ++ sensord.service | 2 +- sensord.sysconfig | 5 +++++ 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lm_sensors-modprobe b/lm_sensors-modprobe index 4d7e753..7d83ed6 100755 --- a/lm_sensors-modprobe +++ b/lm_sensors-modprobe @@ -1,6 +1,6 @@ #!/bin/sh if [ $# -ne 0 ]; then - /sbin/modprobe -ab $@ + /usr/sbin/modprobe -ab $@ else echo "No sensors with loadable kernel modules configured." echo "Please, run 'sensors-detect' as root in order to search for available sensors." diff --git a/lm_sensors-modprobe-r b/lm_sensors-modprobe-r index 46027cf..c678c12 100755 --- a/lm_sensors-modprobe-r +++ b/lm_sensors-modprobe-r @@ -1,6 +1,6 @@ #!/bin/sh if [ $# -ne 0 ]; then - /sbin/modprobe -abr $@ + /usr/sbin/modprobe -abr $@ else echo "No sensors with loadable kernel modules configured." echo "Please, run 'sensors-detect' as root in order to search for available sensors." diff --git a/lm_sensors.spec b/lm_sensors.spec index a1d5f56..bf15b3c 100644 --- a/lm_sensors.spec +++ b/lm_sensors.spec @@ -1,6 +1,6 @@ Name: lm_sensors Version: 3.3.4 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Hardware monitoring tools Group: Applications/System License: LGPLv2+ and GPLv3+ and GPLv2+ and Verbatim and Public domain @@ -21,6 +21,7 @@ Patch1: lm_sensors-3.3.4-lm_sensors-service-modprobe-warnings.patch Patch2: lm_sensors-3.3.4-man-sensors-conf-conv.patch Patch3: lm_sensors-3.3.4-sensors-detect-ppc-missing-vendor_id.patch +Requires: /usr/sbin/modprobe %ifarch %{ix86} x86_64 Requires: /usr/sbin/dmidecode %endif @@ -28,6 +29,7 @@ Requires(post): systemd-units BuildRequires: kernel-headers >= 2.2.16, bison, libsysfs-devel, flex, gawk BuildRequires: rrdtool-devel + %description The lm_sensors package includes a collection of modules for general SMBus access and hardware monitoring. @@ -72,6 +74,10 @@ database, and warns of sensor alarms. mv prog/init/README prog/init/README.initscripts chmod -x prog/init/fancontrol.init +# fixing the sensord-service-wrapper path +cp -p %{SOURCE5} sensord.service +sed -i "s|\@WRAPPER_DIR\@|%{_libexecdir}/%{name}|" sensord.service + %build export CFLAGS="%{optflags}" @@ -96,7 +102,7 @@ install -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/sensord mkdir -p $RPM_BUILD_ROOT%{_unitdir} install -pm 644 prog/init/lm_sensors.service $RPM_BUILD_ROOT%{_unitdir} install -pm 644 prog/init/fancontrol.service $RPM_BUILD_ROOT%{_unitdir} -install -pm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_unitdir} +install -pm 644 sensord.service $RPM_BUILD_ROOT%{_unitdir} # customized modprobe calls mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/%{name} @@ -177,6 +183,10 @@ fi %changelog +* Fri Jan 10 2014 Jaromir Capik - 3.3.4-10 +- Enhancing the sensord service wrapper (#863986) +- UsrMove and libexec path tunings + * Thu Jan 09 2014 Jaromir Capik - 3.3.4-9 - Introducing sensord service wrapper (#949521) diff --git a/sensord-service-wrapper b/sensord-service-wrapper index b362be1..70ca0f1 100755 --- a/sensord-service-wrapper +++ b/sensord-service-wrapper @@ -7,5 +7,7 @@ ARGS="" [ "$LOG_INTERVAL" = "" ] || ARGS=`echo "$ARGS -l $LOG_INTERVAL"` [ "$RRD_INTERVAL" = "" ] || ARGS=`echo "$ARGS -t $RRD_INTERVAL"` [ "$RRD_LOGFILE" = "" ] || ARGS=`echo "$ARGS -r $RRD_LOGFILE"` +[ "$RRD_NO_AVG" = "1" ] && ARGS=`echo "$ARGS -T"` +[ "$LOAD_AVG" = "1" ] && ARGS=`echo "$ARGS -a"` /usr/sbin/sensord -f daemon $ARGS diff --git a/sensord.service b/sensord.service index ddcb9fc..9a13082 100644 --- a/sensord.service +++ b/sensord.service @@ -7,7 +7,7 @@ After=syslog.target EnvironmentFile=-/etc/sysconfig/sensord Type=forking PIDFile=/var/run/sensord.pid -ExecStart=/usr/libexec/lm_sensors/sensord-service-wrapper +ExecStart=@WRAPPER_DIR@/sensord-service-wrapper [Install] WantedBy=multi-user.target diff --git a/sensord.sysconfig b/sensord.sysconfig index 2d251c9..e65fdc8 100644 --- a/sensord.sysconfig +++ b/sensord.sysconfig @@ -14,3 +14,8 @@ LOG_INTERVAL=20m # RRD db location # RRD_LOGFILE=/var/log/sensors.rrd +# Switch RRD in non-average mode ... 1 - enabled, 0 - disabled (default) +# RRD_NO_AVG=1 + +# Include load average in RRD ... 1 - enabled, 0 - disabled (default) +# LOAD_AVG=1