From 91bf03f8c1a3191706a91be2767686cc71847a1d Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: May 01 2022 21:58:33 +0000 Subject: backend: automatically restart services in %post Fix #2141 I asked on `#fedora-devel` about restarting a target and the response was "What would restarting target even mean?". I also didn't find any mentions of restarting targets in the documentation. The `man systemd.target` doesn't go into detail about the possible use-cases of targets, it only mentions "grouping units and as well-known synchronization points during start-up." ArchWiki even equates targets to SysV runlevels, https://wiki.archlinux.org/title/systemd#Targets so in this context, restarting targets doesn't make sense as well. I don't know if our `copr-backend.target` is a valid use-case but it IMHO doesn't matter. We can file a RFE for supporting targets in `%systemd_postun_with_restart` but for the time being, I would just change our specfile and list all services that should be restarted. --- diff --git a/backend/copr-backend.spec b/backend/copr-backend.spec index 78c836b..baa3e40 100644 --- a/backend/copr-backend.spec +++ b/backend/copr-backend.spec @@ -200,7 +200,9 @@ useradd -r -g copr -G lighttpd -s /bin/bash -c "COPR user" copr %systemd_preun copr-backend.target %postun -%systemd_postun_with_restart copr-backend.target +%systemd_postun_with_restart copr-backend-log.service +%systemd_postun_with_restart copr-backend-build.service +%systemd_postun_with_restart copr-backend-action.service %files %license LICENSE