Dropped sysvinit support

This commit is contained in:
Jaroslav Škarvada 2018-11-15 11:51:29 +01:00
parent 6ed003a6ba
commit 5c1d578003
2 changed files with 4 additions and 143 deletions

View File

@ -1,115 +0,0 @@
#!/bin/bash
#
# /etc/rc.d/init.d/acpid
#
# Starts the acpi daemon
#
# chkconfig: 345 26 74
# description: Listen and dispatch ACPI events from the kernel
# processname: acpid
### BEGIN INIT INFO
# Provides: acpid
# Required-Start: $syslog $local_fs
# Required-Stop: $syslog $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop acpid
# Description: Listen and dispatch ACPI events from the kernel
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/acpid
RETVAL=0
#
# See how we were called.
#
check() {
# Check that we're a privileged user
[ `id -u` = 0 ] || exit 4
# Check if acpid is executable
test -x /usr/sbin/acpid || exit 5
}
start() {
check
# Check if it is already running
if [ ! -f /var/lock/subsys/acpid ]; then
echo -n $"Starting acpi daemon: "
daemon /usr/sbin/acpid $OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
echo
fi
return $RETVAL
}
stop() {
check
echo -n $"Stopping acpi daemon: "
killproc /usr/sbin/acpid
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/acpid
echo
return $RETVAL
}
restart() {
stop
start
}
reload() {
check
trap "" SIGHUP
action $"Reloading acpi daemon:" killall -HUP acpid
RETVAL=$?
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
force-reload)
echo "$0: Unimplemented feature."
RETVAL=3
;;
restart)
restart
;;
condrestart)
if [ -f /var/lock/subsys/acpid ]; then
restart
fi
;;
status)
status acpid
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
RETVAL=2
esac
exit $RETVAL

View File

@ -8,11 +8,10 @@
Summary: ACPI Event Daemon
Name: acpid
Version: 2.0.30
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2+
Group: System Environment/Daemons
Source: http://downloads.sourceforge.net/acpid2/%{name}-%{version}.tar.xz
Source1: acpid.init
Source2: acpid.video.conf
Source3: acpid.power.conf
Source4: acpid.power.sh
@ -32,17 +31,6 @@ Requires: systemd
%description
acpid is a daemon that dispatches ACPI events to user-space programs.
%if 0%{?fedora} < 23
%package sysvinit
Summary: ACPI Event Daemon
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires(preun): /sbin/service
%description sysvinit
The acpid-sysvinit contains SysV initscript.
%endif
%prep
%setup -q
%patch0 -p1 -b .kacpimon-dynamic-connections
@ -68,11 +56,6 @@ install -p -m 755 %{SOURCE4} %{buildroot}%{_sysconfdir}/acpi/actions/power.sh
install -p -m 644 %{SOURCE5} %{SOURCE7} %{buildroot}%{_unitdir}
install -p -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/acpid
%if 0%{?fedora} < 23
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
install -p -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/acpid
%endif
%files
%doc %{_docdir}/%{name}
%{_unitdir}/%{name}.service
@ -91,11 +74,6 @@ install -p -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/acpid
%{_mandir}/man8/acpi_listen.8.gz
%{_mandir}/man8/kacpimon.8.gz
%if 0%{?fedora} < 23
%files sysvinit
%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/acpid
%endif
%pre
if [ "$1" = "2" ]; then
conflist=`ls %{_sysconfdir}/acpi/events/*.conf 2> /dev/null`
@ -121,12 +99,10 @@ fi
/sbin/chkconfig --del acpid >/dev/null 2>&1 || :
/bin/systemctl try-restart acpid.service >/dev/null 2>&1 || :
%if 0%{?fedora} < 23
%triggerpostun -n %{name}-sysvinit -- %{name} < 2.0.10-2
/sbin/chkconfig --add acpid >/dev/null 2>&1 || :
%endif
%changelog
* Thu Nov 15 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 2.0.30-2
- Dropped sysvinit support
* Thu Jul 19 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 2.0.30-1
- New version
Resolves: rhbz#1602974