On Thu, Jul 29, 2021 at 01:51:46PM +0100, Joe Orton wrote: > On Wed, Jul 28, 2021 at 09:07:58AM -0400, Ben Cotton wrote: > > Note from the change owner: I'm submitting this as very-very-late > > change for F35. The implementation in systemd is mostly done, so it'll > > become available in rawhide pretty soon. To actually make use of the > > new functionality, individual packages should be changed to use > > _with_restart in their scriptlets and rebuilt. This will happen over > > time, and it's fine if each package does that on its own schedule. We > > still do not have that many user services, and restarting from > > packaging scriptlets will be possible and appropriate only for some of > > them. I think it's important to make the functionality available, > > without trying to use it everywhere immediately. > > > > https://fedoraproject.org/wiki/Changes/Restart_User_Service_after_Upgrade > > We've been restarting httpd on upgrades in %posttrans for a while, so > it's good to see a more general version of this available. A couple of > notes: > > 1) Users asked to be able to turn this off ("why did running dnf break > my web server" etc), which I think is reasonable, we added a crude > mechanism (touch /etc/sysconfig/thing) to disable it. > > 2) Blocking the dnf transaction from completing before the service > restarts turned out to be quite painful UX and we now only run > try-restart with --no-block. Depending on the service or service > configuration there it can be a significant delay. Obviously a trade-off > here since it can hide the failure case. httpd is special because the restart is slow… but this should be an exception I think. 'systemctl --user daemon-reexec' takes 0.260 on my laptop, and the restart of user services would be fairly quick too. The new macros are blocking (like the previous macros for system services), though the timeout is limited to 15 s to prevent blocking of the upgrade by unprivileged code. I expect the typical restart to be <<1s, so this should be more than enough. Synchronous restart is nice when the update is part of some script: 'sudo dnf install … && call-some-command-that-uses-the-new-api'. This also includes stuff called internally as part of the dnf transaction from the scriptlets: sometimes the dependent packages will require the new functionality. That said, individual packages can use a different form of scriptlets to make the restart asynchronous (or skip it entirely), as appropriate. I think that restart of most applications should be invisible or at most cause a transient glitch, e.g. loss of audio while some application is being restarted. I think this would be an acceptable trade-off, better than asking users to deal with the issue. But each app is different: httpd vs. pipewire vs. firefox vs. tracker-miner-fs-3.service… I'm sure that different solution will need to be used. > I tried to trace through the systemd macros (the links from the Change > wiki under "Macro details" are broken) and it looks like you do block on > restart/reload, is that worth reconsidering? Maybe we could wrap the > systemd macros to achieve (1) as well for httpd, but I'd say that it > might be a more generally useful feature too to allow users control over > this feature. I don't see this, the links work for me. I updated the formatting a bit. Zbyszek _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure