Use the new systemd macros
The macros are primarily targeted at services that can be enabled/disabled, while polkit.service is D-Bus-activated only. However, they hide/ignore the caused failures while performing the required daemon reloads, so we can use the same abstraction as every other unit.
This commit is contained in:
parent
7177e8ca49
commit
d049388b01
23
polkit.spec
23
polkit.spec
@ -29,6 +29,9 @@ BuildRequires: libtool
|
|||||||
Requires: dbus, js, polkit-pkla-compat
|
Requires: dbus, js, polkit-pkla-compat
|
||||||
|
|
||||||
Requires(pre): shadow-utils
|
Requires(pre): shadow-utils
|
||||||
|
Requires(post): /sbin/ldconfig, systemd
|
||||||
|
Requires(preun): systemd
|
||||||
|
Requires(postun): /sbin/ldconfig, systemd
|
||||||
|
|
||||||
Obsoletes: PolicyKit <= 0.10
|
Obsoletes: PolicyKit <= 0.10
|
||||||
Provides: PolicyKit = 0.11
|
Provides: PolicyKit = 0.11
|
||||||
@ -102,9 +105,23 @@ getent group polkitd >/dev/null || groupadd -r polkitd
|
|||||||
getent passwd polkitd >/dev/null || useradd -r -g polkitd -d / -s /sbin/nologin -c "User for polkitd" polkitd
|
getent passwd polkitd >/dev/null || useradd -r -g polkitd -d / -s /sbin/nologin -c "User for polkitd" polkitd
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
%post
|
||||||
|
/sbin/ldconfig
|
||||||
|
# The implied (systemctl preset) will fail and complain, but the macro hides
|
||||||
|
# and ignores the fact. This is in fact what we want, polkit.service does not
|
||||||
|
# have an [Install] section and it is always started on demand.
|
||||||
|
%systemd_post polkit.service
|
||||||
|
|
||||||
%postun -p /sbin/ldconfig
|
%preun
|
||||||
|
%systemd_preun polkit.service
|
||||||
|
|
||||||
|
%postun
|
||||||
|
/sbin/ldconfig
|
||||||
|
# Not %%systemd_postun_with_restart - let's err on the side of safety, and keep
|
||||||
|
# the daemon, with its temporary authorizations and agent registrations, running
|
||||||
|
# after the upgrade as well; it would be unfortunate if the upgrade tool failed
|
||||||
|
# because a component can't handle polkitd losing state.
|
||||||
|
%systemd_postun
|
||||||
|
|
||||||
%files -f polkit-1.lang
|
%files -f polkit-1.lang
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
@ -148,6 +165,8 @@ exit 0
|
|||||||
%changelog
|
%changelog
|
||||||
* Fri May 10 2013 Miloslav Trmač <mitr@redhat.com> - 0.110-4
|
* Fri May 10 2013 Miloslav Trmač <mitr@redhat.com> - 0.110-4
|
||||||
- Build with V=1
|
- Build with V=1
|
||||||
|
- Use the new systemd macros, primarily to run (systemctl daemon-reload)
|
||||||
|
Resolves: #857382
|
||||||
|
|
||||||
* Fri May 10 2013 Miloslav Trmač <mitr@redhat.com> - 0.110-4
|
* Fri May 10 2013 Miloslav Trmač <mitr@redhat.com> - 0.110-4
|
||||||
- Make the JavaScript engine mandatory. The polkit-js-engine package has been
|
- Make the JavaScript engine mandatory. The polkit-js-engine package has been
|
||||||
|
Loading…
Reference in New Issue
Block a user