I really love this idea because users (sysadmins) will get the ability to *not* restart some production-critical services on upgrade if they decide so without rebuilding package with removed scriptlets. I don't have suggestions about syntax, but whatever systemd upstream comes up with is good for me. On Thu, Jan 2, 2020 at 4:16 PM Ben Cotton <bcotton@xxxxxxxxxx> wrote: > > https://fedoraproject.org/wiki/Changes/Restart_services_at_end_of_rpm_transaction > > == Summary == > > Scriptlets to restart each service that should be restarted in each > rpm package will be replaced by a declaration in the unit file and an > rpm transaction trigger that fires at the end and restarts all > services. > > == Owner == > * Name: [[User:zbyszek| Zbigniew Jędrzejewski-Szmek]] > * Email: zbyszek at in waw pl > > > == Detailed Description == > > Currently, when packages containing systemd services are upgraded, > they are restarted through %post scriptlets in each package. In other > words, the scriptlets specify which services should be restarted and > actually run the command to restart the service. An alternative > mechanism will be provided, whereby the unit file contains a setting > which specifies that the service should be restarted on upgrade, and a > %transfiletrigger in the systemd package will restart all services > marked so in upgraded packages at the end of transaction. > > To mark a services as "restart on upgrade" the unit file should > contain an option to mark it so. This can be either in the main > .service file, or e.g. in a drop-in file in > <code>/usr/lib/systemd/system/<service>.service.d/needs-restart.conf</code>. > The exact name of the option should be something like > <code>X-restart-on-upgrade=true|false</code>. I'll take the proposal > for discussion in systemd upstream, since this is something that could > be used across distributions, and then the "X-" prefix could be > dropped and/or the name changed. > > == Benefit to Fedora == > > Which services should be restarted is specified declaratively and the > number of scriptlets is reduced. > > Admins may easily override this by providing appropriate drop-ins of > their own of higher priority. > > Services are restarted after the transaction is finished, all > libraries have been upgraded, and systemd configuration reloaded. This > solves https://bugzilla.redhat.com/show_bug.cgi?id=1614751, but also a > more general problem: a service may be restarted before any of its > dependencies (files and static content and whatnot) have been > upgraded, and while some contents from the old rpm are still on disk. > Restarting after all packages have been upgraded avoids this issue. > > In the future, restarting of services shall also be extended to user > managers (i.e. to restart all user services after the packages > providing those services have been upgraded). This is not part of this > proposal, but moving the information what to restart into systemd > units makes this much easier. > > == Scope == > * Proposal owners: > ** implement the relevant bits in the systemd package > ** submit a proposal to FPC > ** convert a subset of packages > > * Other developers: > ** FPC: review (and accept ;)) the guidelines changes > ** other maintainers: convert other packages > > * Release engineering: n/a > > * Policies and guidelines: a pull request will be submitted > > * Trademark approval: N/A (not needed for this Change) > > == Upgrade/compatibility impact == > This change should be backwards compatible, i.e. unconverted packages > can be still installed on new systems, and services will be restarted > on upgrade like before. Converted packages may be installed on older > systems but will not get restarted on upgrades. > > == How To Test == > This change should be mostly invisible to users. Check that during > upgrades services are restarted and that no warnings are emitted. > > == User Experience == > N/A > > == Dependencies == > N/A > > == Contingency Plan == > > * Contingency mechanism: Revert to previous mechanism. This will > require a revert of changes to the spec file and a rebuild of the > package. > > * Contingency deadline: beta freeze > * Blocks release? No > * Blocks product? No > > == Documentation == > TBD. > > == Release Notes == > Not needed. > > -- > Ben Cotton > He / Him / His > Fedora Program Manager > Red Hat > TZ=America/Indiana/Indianapolis > _______________________________________________ > devel-announce mailing list -- devel-announce@xxxxxxxxxxxxxxxxxxxxxxx > To unsubscribe send an email to devel-announce-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-announce@xxxxxxxxxxxxxxxxxxxxxxx _______________________________________________ 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