743dd47 fix git-daemon systemd scriptlets (#1785088)

Authored and Committed by tmz 4 years ago
1 file changed. 7 lines added. 4 lines removed.
    fix git-daemon systemd scriptlets (#1785088)
    
    When upgrading or reinstalling git-daemon, the rpm %postun scriptlet
    runs the %systemd_postun_with_restart macro with git@.service as the
    argument.  The macro calls 'systemctl try-restart git@.service' which
    produces an error:
    
        $ dnf -y update git-daemon
        [...]
          Running scriptlet: git-daemon-2.24.1-1.fc31.x86_64                        2/2
        Failed to try-restart git@.service: Unit name git@.service is missing the instance name.
        See system logs and 'systemctl status git@.service' for details.
    
    Until systemd-242, the error was hidden because the systemd scriptlets
    directed all output to /dev/null.  That was changed in systemd commit
    b0ca726585 (rpm: avoid hiding errors from systemd commands, 2019-03-20),
    exposing this bug in the git-daemon scriptlets.
    
    The misconfiguration also leaves a stale symlink in /etc/systemd if
    git.socket is enabled.  Removing the git-daemon package and installing
    again later results in git.socket being enabled.
    
    Neither of these are the expected nor intended outcomes.  Replace
    git@.service with git.socket in the systemd scriptlets.
    
    The issue was introduced in 906d847 (Rename git.service into
    git@.service and bump release, 2014-10-24).  It went unnoticed until now
    largely because the systemd scriptlets hid their output.
    
        
file modified
+7 -4