Dominique Leuenberger changed bug 968405
What Removed Added
Flags needinfo?(dimstar@opensuse.org)  

Comment # 26 on bug 968405 from
(In reply to Egbert Eich from comment #25)
> This could be fixed easily - ie by testing the env variable also before we
> source the syconfig/services file. 

agreed - one solution

> However the macros you mentioned in comment #9 (ie the ones from
> systemd-rpm-macros) did not play a role in this ticket at all. 
> The macros which play a role here are from the rpm package and admittedly
> exhibit the same behaviour as the ones from comment #9.

Good pointer - thanks, but:

> We need to address all of these cases therefore I'm going to include the
> maintainer of RPM again.

Indeed, we have two places failing through the same loop:

%service_del_postun is defined in two places:
/etc/rpm/macros.systemd
/usr/lib/rpm/macros

Looking at xdm, you got the one from /etc/rpm/macros.systemd (thus, the entire
discussion so far stays true)

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

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.


You are receiving this mail because: