From 17a4317a2116b87635b510f2508ec6ff5f1ec818ed43b0bb10690a340da65b76 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 2 Jul 2014 12:56:02 +0000 Subject: [PATCH 1/4] - Add pre/post hooks for sensord service. - Add sysconfig template for sensord service (bnc#882719). OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=77 --- sensors.changes | 6 ++++++ sensors.spec | 16 +++++++++++++++- sysconfig.sensord | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 sysconfig.sensord diff --git a/sensors.changes b/sensors.changes index c5c0267..843d506 100644 --- a/sensors.changes +++ b/sensors.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 2 12:22:44 UTC 2014 - jdelvare@suse.com + +- Add pre/post hooks for sensord service. +- Add sysconfig template for sensord service (bnc#882719). + ------------------------------------------------------------------- Tue Jan 28 09:08:45 CET 2014 - jdelvare@suse.de diff --git a/sensors.spec b/sensors.spec index c7d21f5..5d35f7e 100644 --- a/sensors.spec +++ b/sensors.spec @@ -109,9 +109,10 @@ make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} M cp -a COPYING $RPM_BUILD_ROOT/%{_docdir}/sensord/ chmod -R u+rwX,g+rX,o+rX $RPM_BUILD_ROOT/%{_docdir}/sensors/ $RPM_BUILD_ROOT/%{_docdir}/sensord/ chmod 0755 $RPM_BUILD_ROOT/%{_libdir}/libsensors.so.* - mkdir -p $RPM_BUILD_ROOT/%{_unitdir} + mkdir -p $RPM_BUILD_ROOT/%{_unitdir} $RPM_BUILD_ROOT/%{_localstatedir}/adm/fillup-templates cp -a prog/init/*.service $RPM_BUILD_ROOT/%{_unitdir}/ ln -sf /sbin/service %{buildroot}/usr/sbin/rclm_sensors + cp -a sysconfig.sensord $RPM_BUILD_ROOT/%{_localstatedir}/adm/fillup-templates %pre %service_add_pre lm_sensors.service @@ -146,6 +147,18 @@ fi %postun %service_del_postun lm_sensors.service +%pre -n sensord +%service_add_pre sensord.service + +%post -n sensord +%service_add_post sensord.service + +%preun -n sensord +%service_del_preun sensord.service + +%postun -n sensord +%service_del_postun sensord.service + %post -n libsensors4 -p /sbin/ldconfig %postun -n libsensors4 -p /sbin/ldconfig @@ -184,6 +197,7 @@ fi %files -n sensord %defattr(-,root,root) %{_unitdir}/sensord.service +%{_localstatedir}/adm/fillup-templates/sysconfig.sensord /usr/sbin/sensord %dir %{_docdir}/sensord %doc %{_docdir}/sensord/COPYING diff --git a/sysconfig.sensord b/sysconfig.sensord new file mode 100644 index 0000000..c441446 --- /dev/null +++ b/sysconfig.sensord @@ -0,0 +1,19 @@ +## Path: Hardware/Sensors Monitoring Daemon +## Description: Configuration for the hardware sensors monitoring daemon (sensord) +## ServiceRestart: sensord + +## Type: string +## Default: "1m" +# +# Interval between scanning for alarms. Use suffix "s" for seconds, "m" for +# minutes, "h" for hours. 0 turns off scanning for alarms. +# +INTERVAL="1m" + +## Type: string +## Default: "20m" +# +# Interval between logging. Use suffix "s" for seconds, "m" for minutes, "h" +# for hours. 0 turns off logging. +# +LOG_INTERVAL="20m" From faf8b15819c8fba47a6ae49cc7e6b2e5415bdd8f90afe8ce0d1d1793fc534ac5 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 2 Jul 2014 12:58:05 +0000 Subject: [PATCH 2/4] List sysconfig.sensord as a source. OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=78 --- sensors.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/sensors.spec b/sensors.spec index 5d35f7e..42813fe 100644 --- a/sensors.spec +++ b/sensors.spec @@ -29,6 +29,7 @@ License: GPL-2.0+ Group: System/Monitoring Requires: modutils Source0: http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-%{version}.tar.bz2 +Source1: sysconfig.sensord Source2: baselibs.conf Patch1: lm_sensors-3.1.1-build.patch Patch2: lm_sensors-3.0.0-sensord-separate.patch From fde7bea0930c21c1f4dbc39f3c1958a8b2969841be1470b81052a9b47f5dd336 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 2 Jul 2014 13:42:50 +0000 Subject: [PATCH 3/4] Fix source file reference. OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=79 --- sensors.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensors.spec b/sensors.spec index 42813fe..9cf2dab 100644 --- a/sensors.spec +++ b/sensors.spec @@ -113,7 +113,7 @@ make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} M mkdir -p $RPM_BUILD_ROOT/%{_unitdir} $RPM_BUILD_ROOT/%{_localstatedir}/adm/fillup-templates cp -a prog/init/*.service $RPM_BUILD_ROOT/%{_unitdir}/ ln -sf /sbin/service %{buildroot}/usr/sbin/rclm_sensors - cp -a sysconfig.sensord $RPM_BUILD_ROOT/%{_localstatedir}/adm/fillup-templates + cp -a %{SOURCE1} $RPM_BUILD_ROOT/%{_localstatedir}/adm/fillup-templates %pre %service_add_pre lm_sensors.service From 3b4e5e06b047a6603db12ae0fd993052f216f9b91fb28bf21b29470e89492877 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 3 Jul 2014 11:25:53 +0000 Subject: [PATCH 4/4] - Actually create the sensord service configuration file from the template (bnc#882719). OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=80 --- sensors.changes | 6 ++++++ sensors.spec | 2 ++ 2 files changed, 8 insertions(+) diff --git a/sensors.changes b/sensors.changes index 843d506..8e9a403 100644 --- a/sensors.changes +++ b/sensors.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jul 3 11:25:08 UTC 2014 - jdelvare@suse.com + +- Actually create the sensord service configuration file from the + template (bnc#882719). + ------------------------------------------------------------------- Wed Jul 2 12:22:44 UTC 2014 - jdelvare@suse.com diff --git a/sensors.spec b/sensors.spec index 9cf2dab..65f5c27 100644 --- a/sensors.spec +++ b/sensors.spec @@ -53,6 +53,7 @@ Summary: Hardware health monitoring daemon License: GPL-2.0+ Group: System/Monitoring Provides: sensors:/usr/sbin/sensord +Requires(pre): %fillup_prereq %description -n sensord sensord is a daemon that can be used to periodically log sensor @@ -153,6 +154,7 @@ fi %post -n sensord %service_add_post sensord.service +%{fillup_only -n sensord} %preun -n sensord %service_del_preun sensord.service