(In reply to Dominique Leuenberger from comment #26) > > %service_del_postun is defined in two places: > /etc/rpm/macros.systemd > /usr/lib/rpm/macros Ah, I didn't even notice that. It would be nice if we had the chance to consolidate this in the process. > Looking at xdm, you got the one from /etc/rpm/macros.systemd (thus, the > entire discussion so far stays true) Right. > > Besides this - you are talking about 'update' - how do you distinguish > > 'update' from 'removal' using the '%pre/%postun' scriptlets? > > This may not even matter for the case at hand but since you are looking at > > the 'general' case, you may have to. > > /etc/rpm/macros.systemd's %service_del_postun expands to: > # On uninstall, tell systemd to reload its unit files > %service_del_postun() > \ > test -n "$FIRST_ARG" || FIRST_ARG="$1" > \ > if [ "$FIRST_ARG" -ge 1 ]; then > \ > # Package upgrade, not uninstall > \ > if [ -x /usr/bin/systemctl ]; then > \ > /usr/bin/systemctl daemon-reload || : > \ > ( %_restart_check_systemctl %{?*} || : ) > \ > fi > \ > else # package uninstall > \ > for service in %{?*} ; do > \ > sysv_service="${service%.*}" > \ > rm -f "/var/lib/systemd/migrated/$sysv_service" || : > \ > done > \ > if [ -x /usr/bin/systemctl ]; then > \ > /usr/bin/systemctl daemon-reload || : > \ > fi > \ > fi > \ > %{nil} > > > Updated vs uninstall is handled in the script. Ok, I now faintly remember that there is an argument passed to the %pre/%postun scripts. > > for reference, %_restart_check_systemctl expands to: > > %_restart_check_systemctl > \ > test -f /etc/sysconfig/services && . /etc/sysconfig/services > \ > test "$YAST_IS_RUNNING" = instsys && exit 0 > \ > test "$DISABLE_RESTART_ON_UPDATE" = yes && exit 0 > \ > /usr/bin/systemctl try-restart %{nil} > > And here lies the problem - export DUSABLE_RESTART_ON_UPDATE=yes (as set by > xdm.spec) is overwritten by sourcing /etc/sysconfig/services and the system > default being taken into account - resulting in the issue we now discuss / > hopefully try to fix. Which I mentioned already more than once. So agreed.