From 743dd47b9ac1e6b76c531a2948c6a3673646178f Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Thu, 19 Dec 2019 01:49:10 -0500 Subject: [PATCH] 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. --- git.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/git.spec b/git.spec index 0267e78..b7af5f2 100644 --- a/git.spec +++ b/git.spec @@ -93,7 +93,7 @@ Name: git Version: 2.24.1 -Release: 1%{?rcrev}%{?dist} +Release: 2%{?rcrev}%{?dist} Summary: Fast Version Control System License: GPLv2 URL: https://git-scm.com/ @@ -878,13 +878,13 @@ rmdir --ignore-fail-on-non-empty "$testdir" %if %{use_systemd} %post daemon -%systemd_post git@.service +%systemd_post git.socket %preun daemon -%systemd_preun git@.service +%systemd_preun git.socket %postun daemon -%systemd_postun_with_restart git@.service +%systemd_postun_with_restart git.socket %endif # endif use_systemd @@ -1029,6 +1029,9 @@ rmdir --ignore-fail-on-non-empty "$testdir" %{?with_docs:%{_pkgdocdir}/git-svn.html} %changelog +* Thu Dec 19 2019 Todd Zullinger - 2.24.1-2 +- fix git-daemon systemd scriptlets (#1785088) + * Tue Dec 10 2019 Todd Zullinger - 2.24.1-1 - update to 2.24.1 (CVE-2019-1348, CVE-2019-1349, CVE-2019-1350, CVE-2019-1351, CVE-2019-1352, CVE-2019-1353, CVE-2019-1354, and CVE-2019-1387)