From 2eb89b85eb89fa80330a67f139dfdd208acf88b3 Mon Sep 17 00:00:00 2001 From: Jaroslav Škarvada Date: Jan 13 2014 09:51:04 +0000 Subject: Use socket activation, fix rpmlint tabs vs spaces warnings. --- diff --git a/acpid.service b/acpid.service index 553b3e2..fef3569 100644 --- a/acpid.service +++ b/acpid.service @@ -1,18 +1,11 @@ [Unit] Description=ACPI Event Daemon -After=syslog.target - -# This could probably benefit from socket activation, but honestly I think it -# is time for acpid to go away, and hence I am not planning to spend the time -# to add socket activation here. We use Type=forking to ensure that the -# communication sockets are in place before boot proceeds with any service -# needing this service. Would acpid support socket activation we could use -# Type=simple here. +Documentation=man:acpid(8) +Requires=acpid.socket [Service] -Type=forking EnvironmentFile=/etc/sysconfig/acpid -ExecStart=/usr/sbin/acpid $OPTIONS +ExecStart=/usr/sbin/acpid -f $OPTIONS [Install] -WantedBy=multi-user.target +Also=acpid.socket diff --git a/acpid.socket b/acpid.socket new file mode 100644 index 0000000..d61cba2 --- /dev/null +++ b/acpid.socket @@ -0,0 +1,9 @@ +[Unit] +Description=ACPID Listen Socket +Documentation=man:acpid(8) + +[Socket] +ListenStream=/var/run/acpid.socket + +[Install] +WantedBy=sockets.target diff --git a/acpid.spec b/acpid.spec index 3ab5aad..aaab828 100644 --- a/acpid.spec +++ b/acpid.spec @@ -8,7 +8,7 @@ Summary: ACPI Event Daemon Name: acpid Version: 2.0.20 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Daemons Source: http://downloads.sourceforge.net/acpid2/%{name}-%{version}.tar.xz @@ -18,6 +18,7 @@ Source3: acpid.power.conf Source4: acpid.power.sh Source5: acpid.service Source6: acpid.sysconfig +Source7: acpid.socket BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExclusiveArch: ia64 x86_64 %{ix86} URL: http://sourceforge.net/projects/acpid2/ @@ -63,7 +64,7 @@ chmod 755 %{buildroot}%{_sysconfdir}/acpi/events install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/acpi/events/videoconf install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/acpi/events/powerconf install -m 755 %{SOURCE4} %{buildroot}%{_sysconfdir}/acpi/actions/power.sh -install -m 644 %{SOURCE5} %{buildroot}/lib/systemd/system +install -m 644 %{SOURCE5} %{SOURCE7} %{buildroot}/lib/systemd/system install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/acpid mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d @@ -78,6 +79,7 @@ rm -rf %{buildroot} %defattr(-,root,root) %doc %{_docdir}/%{name} /lib/systemd/system/%{name}.service +/lib/systemd/system/%{name}.socket %dir %{_sysconfdir}/acpi %dir %{_sysconfdir}/acpi/events %dir %{_sysconfdir}/acpi/actions @@ -108,23 +110,26 @@ if [ "$1" = "2" ]; then fi %post -%systemd_post %{name}.service +%systemd_post %{name}.socket %{name}.service %preun -%systemd_preun %{name}.service +%systemd_preun %{name}.socket %{name}.service %postun -%systemd_postun_with_restart %{name}.service +%systemd_postun_with_restart %{name}.socket %{name}.service %triggerun -- %{name} < 2.0.10-2 - /sbin/chkconfig --del acpid >/dev/null 2>&1 || : - /bin/systemctl try-restart acpid.service >/dev/null 2>&1 || : + /sbin/chkconfig --del acpid >/dev/null 2>&1 || : + /bin/systemctl try-restart acpid.service >/dev/null 2>&1 || : %triggerpostun -n %{name}-sysvinit -- %{name} < 2.0.10-2 - /sbin/chkconfig --add acpid >/dev/null 2>&1 || : + /sbin/chkconfig --add acpid >/dev/null 2>&1 || : %changelog +* Fri Jan 10 2014 Ville Skyttä - 2.0.20-3 +- Use socket activation, fix rpmlint tabs vs spaces warnings. + * Wed Nov 13 2013 Jaroslav Škarvada - 2.0.20-2 - Fixed loginctl and added support for cinnamon and mate (patch by Leigh Scott) Resolves: rhbz#1029868