Accepting request 207067 from home:posophe:branches:Base:System

- Remove sysvinit support; none of target distributions use it anymore
- Add systemd support

OBS-URL: https://build.opensuse.org/request/show/207067
OBS-URL: https://build.opensuse.org/package/show/Base:System/sensors?expand=0&rev=69
This commit is contained in:
Marcus Meissner 2013-11-21 09:47:07 +00:00 committed by Git OBS Bridge
parent 356f3c4c79
commit d8c3c269f2
3 changed files with 10 additions and 160 deletions

View File

@ -1,148 +0,0 @@
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: lm_sensors
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: Load and configure hardware monitoring drivers
# Description: sensors is used for monitoring motherboard sensor values.
# Config file is /etc/sysconfig/lm_sensors
### END INIT INFO
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
# See also the lm_sensors homepage at:
# http://www.lm-sensors.org
# It uses a config file /etc/sysconfig/lm_sensors that contains the modules
# to be loaded/unloaded. That file is sourced into this one.
# The format of that file a shell script that simply defines the modules
# in order as normal shell variables with the special names:
# MODULE_1, MODULE_2, MODULE_3, etc.
CONFIG=/etc/sysconfig/lm_sensors
LOCK=/var/run/lm_sensors.lock
PSENSORS=/usr/bin/sensors
FANCONFIG=/etc/fancontrol
PFAN=/usr/sbin/fancontrol
# Source function library.
. /etc/rc.status
start() {
echo -n "Starting up sensors"
unset ${!MODULE_*}
test -r "$CONFIG" && . "$CONFIG"
for i in ${!MODULE_*} ; do
eval module=\$$i
/sbin/modprobe $module &>/dev/null
rc_status
done
rc_status
/usr/bin/sensors -s &> /dev/null
rc_status
# Start fan control, if configured
if test -s "$FANCONFIG" -a -x "$PFAN" ; then
echo -n ", starting fan control: "
/sbin/startproc -q "$PFAN"
rc_status
else
echo -n ": "
fi
rc_status -v && touch $LOCK
}
stop() {
echo -n "Shutting down sensors"
unset ${!MODULE_*}
test -r "$CONFIG" && . "$CONFIG"
# Stop fan control, if it was started
if test -s /var/run/fancontrol.pid ; then
echo -n ", stopping fan control: "
/sbin/killproc -TERM "$PFAN"
rc_status
else
echo -n ": "
fi
for i in ${!MODULE_*} ; do
eval module=\$$i
/sbin/modprobe -r $module &>/dev/null
rc_status
done
rc_status -v && rm -f $LOCK
}
dostatus() {
if test -s "$FANCONFIG" -a -x "$PFAN" ; then
echo -n "Checking for fan control daemon: "
/sbin/checkproc "$PFAN"
rc_status -v
fi
if test -e "$LOCK" ; then
$PSENSORS
else
rc_failed 3
fi
rc_status
}
restart() {
stop
start
rc_status
}
condrestart() {
[ -e $LOCK ] && restart || :
}
# Reset status of this service
rc_reset
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
dostatus
;;
restart|reload)
restart
;;
try-restart)
condrestart
;;
*)
echo "Usage: lm_sensors {start|stop|status|restart|reload|try-restart}"
exit 1
esac
rc_exit

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Oct 23 15:38:06 UTC 2013 - p.drouand@gmail.com
- Remove sysvinit support; none of target distributions use it anymore
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jul 1 19:18:59 UTC 2013 - coolo@suse.com Mon Jul 1 19:18:59 UTC 2013 - coolo@suse.com

View File

@ -29,7 +29,6 @@ License: GPL-2.0+
Group: System/Monitoring Group: System/Monitoring
Requires: modutils Requires: modutils
Source0: http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-%{version}.tar.bz2 Source0: http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-%{version}.tar.bz2
Source1: lm_sensors.init
Source2: baselibs.conf Source2: baselibs.conf
Patch1: lm_sensors-3.1.1-build.patch Patch1: lm_sensors-3.1.1-build.patch
Patch2: lm_sensors-3.0.0-sensord-separate.patch Patch2: lm_sensors-3.0.0-sensord-separate.patch
@ -37,7 +36,6 @@ Patch3: lm_sensors-3.0.0-sysconfig_metadata.patch
Patch4: lm_sensors-3.0.3-hint-at-kernel-extra-package.patch Patch4: lm_sensors-3.0.3-hint-at-kernel-extra-package.patch
Patch5: lm_sensors-r6181-fix-service-files.patch Patch5: lm_sensors-r6181-fix-service-files.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: s390 s390x ExcludeArch: s390 s390x
%{?systemd_requires} %{?systemd_requires}
@ -57,7 +55,7 @@ Authors:
Simon G. Vogl <simon@tk.uni-linz.ac.at> Simon G. Vogl <simon@tk.uni-linz.ac.at>
Mark D. Studebaker <mds@eng.paradyne.com> Mark D. Studebaker <mds@eng.paradyne.com>
Philip Edelbrock <phil@netroedge.com> Philip Edelbrock <phil@netroedge.com>
Kyösti Mälkki <kmalkki@cc.hut.fi> Kyösti Mälkki <kmalkki@cc.hut.fi>
Fons Rademakers <Fons.Rademakers@cern.ch> Fons Rademakers <Fons.Rademakers@cern.ch>
Frodo Looijaard <frodol@dds.nl> Frodo Looijaard <frodol@dds.nl>
Geert Uytterhoeven <geert@linux-m68k.org> Geert Uytterhoeven <geert@linux-m68k.org>
@ -99,7 +97,7 @@ Authors:
-------- --------
Mark D. Studebaker <mds@eng.paradyne.com> Mark D. Studebaker <mds@eng.paradyne.com>
Philip Edelbrock <phil@netroedge.com> Philip Edelbrock <phil@netroedge.com>
Kyösti Mälkki <kmalkki@cc.hut.fi> Kyösti Mälkki <kmalkki@cc.hut.fi>
Frodo Looijaard <frodol@dds.nl> Frodo Looijaard <frodol@dds.nl>
Jean Delvare <khali@linux-fr.org> Jean Delvare <khali@linux-fr.org>
Mark M. Hoffman <mhoffman@lightlink.com> Mark M. Hoffman <mhoffman@lightlink.com>
@ -126,7 +124,7 @@ Authors:
-------- --------
Mark D. Studebaker <mds@eng.paradyne.com> Mark D. Studebaker <mds@eng.paradyne.com>
Philip Edelbrock <phil@netroedge.com> Philip Edelbrock <phil@netroedge.com>
Kyösti Mälkki <kmalkki@cc.hut.fi> Kyösti Mälkki <kmalkki@cc.hut.fi>
Frodo Looijaard <frodol@dds.nl> Frodo Looijaard <frodol@dds.nl>
Jean Delvare <khali@linux-fr.org> Jean Delvare <khali@linux-fr.org>
Mark M. Hoffman <mhoffman@lightlink.com> Mark M. Hoffman <mhoffman@lightlink.com>
@ -156,11 +154,9 @@ make %{?_smp_mflags} PROG_EXTRA:=sensord BUILD_STATIC_LIB:=0 PREFIX=%{_prefix} M
chmod -R u+rwX,g+rX,o+rX $RPM_BUILD_ROOT/%{_docdir}/sensors/ chmod -R u+rwX,g+rX,o+rX $RPM_BUILD_ROOT/%{_docdir}/sensors/
cd ../ cd ../
chmod 0755 $RPM_BUILD_ROOT/%{_libdir}/libsensors.so.* chmod 0755 $RPM_BUILD_ROOT/%{_libdir}/libsensors.so.*
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m 0755 %{S:1} $RPM_BUILD_ROOT/etc/init.d/lm_sensors
ln -sf /etc/init.d/lm_sensors $RPM_BUILD_ROOT/usr/sbin/rclm_sensors
mkdir -p $RPM_BUILD_ROOT/%{_unitdir} mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
cp -a prog/init/*.service $RPM_BUILD_ROOT/%{_unitdir}/ cp -a prog/init/*.service $RPM_BUILD_ROOT/%{_unitdir}/
ln -sf /sbin/service %{buildroot}/usr/sbin/rclm_sensors
%pre %pre
%service_add_pre lm_sensors.service %service_add_pre lm_sensors.service
@ -191,11 +187,9 @@ fi
%preun %preun
%service_del_preun lm_sensors.service %service_del_preun lm_sensors.service
%{stop_on_removal lm_sensors}
%postun %postun
%service_del_postun lm_sensors.service %service_del_postun lm_sensors.service
%{insserv_cleanup}
%post -n libsensors4 -p /sbin/ldconfig %post -n libsensors4 -p /sbin/ldconfig
@ -204,9 +198,8 @@ fi
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_unitdir}/lm_sensors.service %{_unitdir}/lm_sensors.service
%{_sbindir}/rclm_sensors
%{_unitdir}/fancontrol.service %{_unitdir}/fancontrol.service
/etc/init.d/lm_sensors
/usr/sbin/rclm_sensors
/usr/bin/* /usr/bin/*
/usr/sbin/fancontrol /usr/sbin/fancontrol
%ifarch i386 i486 i586 i686 x86_64 %ifarch i386 i486 i586 i686 x86_64