Re: No daemon-reload or restart with %systemd_postun_with_restart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 21, 2022 at 08:27:35AM -0400, Sam Varshavchik wrote:
Ewoud Kohl van Wijngaarden writes:

On Fri, Mar 18, 2022 at 06:22:08PM -0400, Sam Varshavchik wrote:
The only thing that https://docs.fedoraproject.org/en-US/packaging-
guidelines/Scriptlets/ tells me to do is to put %systemd_postun_with_restart in my %post. However:

1) systemd complains that it wants a daemon-reload, in order to pick up an updated .service file

2) I still must manually run systemctl reload-or-restart --marked, in order to actually restart an updated service

It seems to be there's a missing step, in here. By comparison I prepared comparable .deb packages for Ubuntu, using dh_installsystemd in the install script. The end result:

A) The initial .deb install enabled and started the service.

B) Bumping the release, rebuilding, and installing the newer package results in an automatic daemon-reload and restart, restarting the service.

Overall .deb's systemd integration seems to go smoother (compared to the rest of the .deb packaging process) than rpm's.

Is there a specific reason why %systemd_postun_with_restart stops before finishing the job? Am I missing something that I can install, to have this happen auto-magically?

I think daemon-reload changed to file triggers in systemd 228:

https://github.com/systemd/systemd/commit/873e413323dfff4023604849c70944674ae5cd29

However, the scriptlets documentation[1] states to use %systemd_post with %post and %systemd_postun_with_restart with %postun. %Perhaps that you're using %systemd_postun_with_restart in %post is the source of your problems?

No, my invocation is in %postun. Furthermore, it wouldn't matter, since at %post time the new package and the new service unit should already be installed and restartable.

And, as I wrote:

1) systemd complains that it wants a daemon-reload, in order to pick up an updated .service file

If ot was "changed to file triggers", well, it's not working since nothing is getting triggered. Furthermore, %systemd_postun_with_restart runs:

/usr/lib/systemd/systemd-update-helper mark-restart-system-units

which does:

systemctl set-property "$unit" Markers=+needs-restart &

That's all it does. Then, as I wrote:

2) I still must manually run systemctl reload-or-restart --marked, in order to actually restart an updated service

So, the shipped systemd scriptlets are still, very much, under an impression that explicit action needs to be taken to restart and/or reload updated .services. But, nothing gets reloaded. The .service files gets marked for a restart, but, from what I can tell, nothing ever gets restarted.

Do you happen to have the spec file and/or the RPMs? How can we replicate the findings?
_______________________________________________
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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux