From 446285fcad1f7af857dd75009dff57f447affc33 Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Thu, 9 Jan 2014 21:13:21 +0100 Subject: [PATCH] - Introducing sensord service wrapper (#949521) --- lm_sensors.spec | 13 +++++++++++-- sensord-service-wrapper | 11 +++++++++++ sensord.service | 13 +++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100755 sensord-service-wrapper create mode 100644 sensord.service diff --git a/lm_sensors.spec b/lm_sensors.spec index 4f65391..a1d5f56 100644 --- a/lm_sensors.spec +++ b/lm_sensors.spec @@ -1,6 +1,6 @@ Name: lm_sensors Version: 3.3.4 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Hardware monitoring tools Group: Applications/System License: LGPLv2+ and GPLv3+ and GPLv2+ and Verbatim and Public domain @@ -13,6 +13,8 @@ Source1: lm_sensors.sysconfig Source2: sensord.sysconfig Source3: lm_sensors-modprobe Source4: lm_sensors-modprobe-r +Source5: sensord.service +Source6: sensord-service-wrapper Patch0: lm_sensors-3.3.4-sensors-detect-null-input.patch Patch1: lm_sensors-3.3.4-lm_sensors-service-modprobe-warnings.patch @@ -92,15 +94,18 @@ install -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/sensord # service files mkdir -p $RPM_BUILD_ROOT%{_unitdir} -install -pm 644 prog/init/sensord.service $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} # customized modprobe calls mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/%{name} install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/modprobe install -pm 755 %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/modprobe-r +# sensord service wrapper +install -pm 755 %{SOURCE6} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/sensord-service-wrapper + # Note non standard systemd scriptlets, since reload / stop makes no sense # for lm_sensors @@ -168,9 +173,13 @@ fi %{_mandir}/man8/sensord.8.gz %config(noreplace) %{_sysconfdir}/sysconfig/sensord %{_unitdir}/sensord.service +%{_libexecdir}/%{name}/sensord-service-wrapper %changelog +* Thu Jan 09 2014 Jaromir Capik - 3.3.4-9 +- Introducing sensord service wrapper (#949521) + * Mon Sep 09 2013 Jaromir Capik - 3.3.4-8 - Fixing use of uninitialized 'vendor_id' value on ppc (#996590) - Fixing bogus date in the changelog diff --git a/sensord-service-wrapper b/sensord-service-wrapper new file mode 100755 index 0000000..b362be1 --- /dev/null +++ b/sensord-service-wrapper @@ -0,0 +1,11 @@ +#!/bin/sh + +. /etc/sysconfig/sensord + +ARGS="" +[ "$INTERVAL" = "" ] || ARGS=`echo "$ARGS -i $INTERVAL"` +[ "$LOG_INTERVAL" = "" ] || ARGS=`echo "$ARGS -l $LOG_INTERVAL"` +[ "$RRD_INTERVAL" = "" ] || ARGS=`echo "$ARGS -t $RRD_INTERVAL"` +[ "$RRD_LOGFILE" = "" ] || ARGS=`echo "$ARGS -r $RRD_LOGFILE"` + +/usr/sbin/sensord -f daemon $ARGS diff --git a/sensord.service b/sensord.service new file mode 100644 index 0000000..ddcb9fc --- /dev/null +++ b/sensord.service @@ -0,0 +1,13 @@ +[Unit] +Description=Log hardware monitoring data +After=lm_sensors.service +After=syslog.target + +[Service] +EnvironmentFile=-/etc/sysconfig/sensord +Type=forking +PIDFile=/var/run/sensord.pid +ExecStart=/usr/libexec/lm_sensors/sensord-service-wrapper + +[Install] +WantedBy=multi-user.target