Accepting request 876971 from home:alarrosa:branches:Base:System
- Add a %systemd_user_pre macro that creates a /run/systemd/rpm/needs-user-preset/$service file for each new service being installed so %systemd_user_post can call `systemctl --global preset $service` properly for newly installed user services (boo#1183051, boo#1183012). OBS-URL: https://build.opensuse.org/request/show/876971 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=63
This commit is contained in:
parent
9f0979dfb3
commit
a079230c8d
@ -172,10 +172,24 @@ fi \
|
||||
%systemd_postun() %{expand::%%service_del_postun_without_restart %{?**}}
|
||||
%systemd_postun_with_restart() %{expand::%%service_del_postun %{?**}}
|
||||
|
||||
%systemd_user_post() \
|
||||
if [ -x /usr/bin/systemctl ] && [ $1 -eq 1 ]; then \
|
||||
%systemd_user_pre() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
for service in %{?*} ; do \
|
||||
if [ ! -e "/usr/lib/systemd/user/$service" ]; then \
|
||||
mkdir -p /run/systemd/rpm/needs-user-preset \
|
||||
touch "/run/systemd/rpm/needs-user-preset/$service" \
|
||||
fi \
|
||||
done \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
%systemd_user_post() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
for service in %{?*} ; do \
|
||||
if [ -e "/run/systemd/rpm/needs-user-preset/$service" ]; then \
|
||||
/usr/bin/systemctl --global preset "$service" || : \
|
||||
rm -f /run/systemd/rpm/needs-user-preset/$service \
|
||||
fi \
|
||||
done \
|
||||
fi \
|
||||
%{nil}
|
||||
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 5 11:03:49 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>
|
||||
|
||||
- Add a %systemd_user_pre macro that creates a
|
||||
/run/systemd/rpm/needs-user-preset/$service file for each new
|
||||
service being installed so %systemd_user_post can call
|
||||
`systemctl --global preset $service` properly for newly
|
||||
installed user services (boo#1183051, boo#1183012).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 4 13:11:15 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user