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:
Franck Bui 2021-03-05 11:09:08 +00:00 committed by Git OBS Bridge
parent affeb11c73
commit 1723d116d2
2 changed files with 26 additions and 3 deletions

View File

@ -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 \
/usr/bin/systemctl --global preset "$service" || : \
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}

View File

@ -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>