diff --git a/lm_sensors-3.3.4-lm_sensors-service-modprobe-warnings.patch b/lm_sensors-3.3.4-lm_sensors-service-modprobe-warnings.patch deleted file mode 100644 index c3c545e..0000000 --- a/lm_sensors-3.3.4-lm_sensors-service-modprobe-warnings.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -Naur lm_sensors-3.3.4.orig/prog/init/lm_sensors.service lm_sensors-3.3.4/prog/init/lm_sensors.service ---- lm_sensors-3.3.4.orig/prog/init/lm_sensors.service 2011-04-27 19:35:18.000000000 +0200 -+++ lm_sensors-3.3.4/prog/init/lm_sensors.service 2013-07-30 17:03:23.918671002 +0200 -@@ -6,9 +6,9 @@ - EnvironmentFile=/etc/sysconfig/lm_sensors - Type=oneshot - RemainAfterExit=yes --ExecStart=-/sbin/modprobe -qab $BUS_MODULES $HWMON_MODULES -+ExecStart=-/usr/libexec/lm_sensors/modprobe $BUS_MODULES $HWMON_MODULES - ExecStart=/usr/bin/sensors -s --ExecStop=-/sbin/modprobe -qabr $BUS_MODULES $HWMON_MODULES -+ExecStop=-/usr/libexec/lm_sensors/modprobe-r $BUS_MODULES $HWMON_MODULES - - [Install] - WantedBy=multi-user.target diff --git a/lm_sensors-modprobe-r b/lm_sensors-modprobe-r-wrapper similarity index 100% rename from lm_sensors-modprobe-r rename to lm_sensors-modprobe-r-wrapper diff --git a/lm_sensors-modprobe b/lm_sensors-modprobe-wrapper similarity index 100% rename from lm_sensors-modprobe rename to lm_sensors-modprobe-wrapper diff --git a/lm_sensors.service b/lm_sensors.service new file mode 100644 index 0000000..904660a --- /dev/null +++ b/lm_sensors.service @@ -0,0 +1,13 @@ +[Unit] +Description=Hardware Monitoring Sensors + +[Service] +EnvironmentFile=/etc/sysconfig/lm_sensors +Type=oneshot +RemainAfterExit=yes +ExecStart=-@WRAPPER_DIR@/lm_sensors-modprobe-wrapper $BUS_MODULES $HWMON_MODULES +ExecStart=/usr/bin/sensors -s +ExecStop=-@WRAPPER_DIR@/lm_sensors-modprobe-r-wrapper $BUS_MODULES $HWMON_MODULES + +[Install] +WantedBy=multi-user.target diff --git a/lm_sensors.spec b/lm_sensors.spec index 4f2a72c..e40df0d 100644 --- a/lm_sensors.spec +++ b/lm_sensors.spec @@ -1,6 +1,6 @@ Name: lm_sensors Version: 3.3.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Hardware monitoring tools Group: Applications/System License: LGPLv2+ and GPLv3+ and GPLv2+ and Verbatim and Public domain @@ -11,13 +11,11 @@ Source: http://dl.lm-sensors.org/lm-sensors/releases/%{name}-%{version}.tar.bz2 Source1: lm_sensors.sysconfig # these 2 were taken from PLD-linux, Thanks! Source2: sensord.sysconfig -Source3: lm_sensors-modprobe -Source4: lm_sensors-modprobe-r +Source3: lm_sensors-modprobe-wrapper +Source4: lm_sensors-modprobe-r-wrapper Source5: sensord.service Source6: sensord-service-wrapper - -Patch1: lm_sensors-3.3.4-lm_sensors-service-modprobe-warnings.patch - +Source7: lm_sensors.service Requires: /usr/sbin/modprobe %ifarch %{ix86} x86_64 @@ -64,15 +62,14 @@ database, and warns of sensor alarms. %prep %setup -q -%patch1 -p1 - - 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 +cp -p %{SOURCE7} lm_sensors.service sed -i "s|\@WRAPPER_DIR\@|%{_libexecdir}/%{name}|" sensord.service +sed -i "s|\@WRAPPER_DIR\@|%{_libexecdir}/%{name}|" lm_sensors.service %build @@ -96,14 +93,14 @@ install -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/sensord # service files 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 lm_sensors.service $RPM_BUILD_ROOT%{_unitdir} install -pm 644 sensord.service $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 +install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/lm_sensors-modprobe-wrapper +install -pm 755 %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/lm_sensors-modprobe-r-wrapper # sensord service wrapper install -pm 755 %{SOURCE6} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/sensord-service-wrapper @@ -156,7 +153,7 @@ fi %{_sbindir}/* %{_unitdir}/lm_sensors.service %{_unitdir}/fancontrol.service -%{_libexecdir}/%{name}/modprobe* +%{_libexecdir}/%{name}/lm_sensors-modprobe*wrapper %config(noreplace) %{_sysconfdir}/sysconfig/lm_sensors %exclude %{_sbindir}/sensord %exclude %{_mandir}/man8/sensord.8.gz @@ -179,6 +176,9 @@ fi %changelog +* Fri Jan 24 2014 Jaromir Capik - 3.3.5-2 +- systemd units rework + * Thu Jan 23 2014 Jaromir Capik - 3.3.5-1 - Update to 3.3.5 (#1056448) diff --git a/lm_sensors.sysconfig b/lm_sensors.sysconfig index c1b5809..334c5ea 100644 --- a/lm_sensors.sysconfig +++ b/lm_sensors.sysconfig @@ -1,2 +1,2 @@ -# /etc/sysconfig/sensors - Defines modules loaded by /etc/rc.d/init.d/lm_sensors -# Run sensors-detect to generate this config file +# /etc/sysconfig/lm_sensors - Defines modules loaded by the lm_sensors service +# Run 'sensors-detect' to generate this config file diff --git a/sensord.service b/sensord.service index 96ae8a5..2bc5539 100644 --- a/sensord.service +++ b/sensord.service @@ -1,5 +1,5 @@ [Unit] -Description=Log hardware monitoring data +Description=Hardware Monitoring Data Logger After=lm_sensors.service [Service] diff --git a/sensord.sysconfig b/sensord.sysconfig index e65fdc8..8f00618 100644 --- a/sensord.sysconfig +++ b/sensord.sysconfig @@ -1,6 +1,6 @@ # configuration for harware sensors monitoring daemon -# in intevrals use suffix "m" for minutes, "s" for seconds, "h" for hours -# 0 means turning facility off +# use suffix "m" for minutes, "s" for seconds, "h" for hours +# 0 turns the facility off # interval between scanning alarms INTERVAL=1m