teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

3c6b3b Use %posttrans instead of %postun to restart services

Authored and Committed by daandemeyer 2 months ago
1 file changed. 19 lines added. 13 lines removed.
    Use %posttrans instead of %postun to restart services
    
    Anything we put in a %postun script needs two releases of the rpm
    before it is invoked. The reason for using %postun to restart services
    is because it runs after the old version has been removed so we can be
    sure all remaining dropins and such files from the old version have been
    removed. %posttrans gives us the same guarantee but the %posttrans of the
    new version will run on install and upgrade which means the changes will
    be applied immediately instead of having to release twice before the changes
    take effect.
    
    We define the systemd_posttrans_with_restart macro in the spec because we
    can't use the upstream one as we ship it ourselves.
    
        
file modified
+19 -13