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:
parent
356f3c4c79
commit
d8c3c269f2
148
lm_sensors.init
148
lm_sensors.init
@ -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
|
@ -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
|
||||
|
||||
|
17
sensors.spec
17
sensors.spec
@ -29,7 +29,6 @@ License: GPL-2.0+
|
||||
Group: System/Monitoring
|
||||
Requires: modutils
|
||||
Source0: http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-%{version}.tar.bz2
|
||||
Source1: lm_sensors.init
|
||||
Source2: baselibs.conf
|
||||
Patch1: lm_sensors-3.1.1-build.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
|
||||
Patch5: lm_sensors-r6181-fix-service-files.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExcludeArch: s390 s390x
|
||||
%{?systemd_requires}
|
||||
|
||||
@ -57,7 +55,7 @@ Authors:
|
||||
Simon G. Vogl <simon@tk.uni-linz.ac.at>
|
||||
Mark D. Studebaker <mds@eng.paradyne.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>
|
||||
Frodo Looijaard <frodol@dds.nl>
|
||||
Geert Uytterhoeven <geert@linux-m68k.org>
|
||||
@ -99,7 +97,7 @@ Authors:
|
||||
--------
|
||||
Mark D. Studebaker <mds@eng.paradyne.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>
|
||||
Jean Delvare <khali@linux-fr.org>
|
||||
Mark M. Hoffman <mhoffman@lightlink.com>
|
||||
@ -126,7 +124,7 @@ Authors:
|
||||
--------
|
||||
Mark D. Studebaker <mds@eng.paradyne.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>
|
||||
Jean Delvare <khali@linux-fr.org>
|
||||
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/
|
||||
cd ../
|
||||
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}
|
||||
cp -a prog/init/*.service $RPM_BUILD_ROOT/%{_unitdir}/
|
||||
ln -sf /sbin/service %{buildroot}/usr/sbin/rclm_sensors
|
||||
|
||||
%pre
|
||||
%service_add_pre lm_sensors.service
|
||||
@ -191,11 +187,9 @@ fi
|
||||
|
||||
%preun
|
||||
%service_del_preun lm_sensors.service
|
||||
%{stop_on_removal lm_sensors}
|
||||
|
||||
%postun
|
||||
%service_del_postun lm_sensors.service
|
||||
%{insserv_cleanup}
|
||||
|
||||
%post -n libsensors4 -p /sbin/ldconfig
|
||||
|
||||
@ -204,9 +198,8 @@ fi
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_unitdir}/lm_sensors.service
|
||||
%{_sbindir}/rclm_sensors
|
||||
%{_unitdir}/fancontrol.service
|
||||
/etc/init.d/lm_sensors
|
||||
/usr/sbin/rclm_sensors
|
||||
/usr/bin/*
|
||||
/usr/sbin/fancontrol
|
||||
%ifarch i386 i486 i586 i686 x86_64
|
||||
|
Loading…
Reference in New Issue
Block a user