-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(RHEL-40878) Backport support for %systemd_postun_with_reload
#250
Conversation
Commit validationTracker - RHEL-40878 The following commits meet all requirements
Tracker validationSuccess🟢 Tracker RHEL-40878 has set desired product: Pull Request validationSuccess🟢 CI - All checks have passed Auto MergeSuccess🟢 Pull Request is not marked as draft and it's not blocked by |
%systemd_postun_with_reload
%systemd_postun_with_reload
(cherry picked from commit e886315) Resolves: RHEL-40878
dbus-broker issues StartUnit directly for activation requests, so let's add a check on bus state in bus_unit_queue_job to refuse that if dbus is not running. Replaces #27570 Closes #26799 (cherry picked from commit 53964fd) Resolves: RHEL-40878
Follow-up for #27579 In #27579 we refused all StartUnit requests for Type=dbus units if dbus is not running, which means if dbus is manually stopped, user can't use systemctl to start Type=dbus units again, which is incorrect. The only culprit that leads to the cancellation of the whole transaction mentioned in #26799 is job type conflict on dbus. So let's relax the restriction and only refuse job enqueuing if dbus has a stop job. To summarize, the case we want to avoid is: 1. dbus has a stop job installed 2. StartUnit/ActivationRequest is received 3. Type=dbus service gets started, which has Requires=dbus.socket 4. dbus is pulled in again, resulting in job type conflict What we can support is: 1. dbus is already stopped 2. StartUnit is received (possibly through systemctl, i.e. on private bus) 3. Type=dbus service gets started, which will wait for dbus to start 4. dbus is started again, thus the job for Type=dbus service Replaces #27590 Fixes #27588 (cherry picked from commit bee6e75) Resolves: RHEL-40878
bus_unit_queue_job_one has two callers: - bus_unit_queue_job which would do the appropriate transormations to turn JOB_TRY_RESTART into JOB_TRY_RELOAD, - and method_enqueue_marked_jobs which did not. In effect, method_enqueue_marked_jobs() would queue restart jobs for units which has Markers= needs-reload or needs-restart. When the chunk of code which does the transformations is moved from bus_unit_queue_job to bus_unit_queue_job_one, there is no change for bus_unit_queue_job, and method_enqueue_marked_jobs is fixed. The additional checks that are done seem reasonable to do from method_enqueue_marked_jobs: we shouldn't be restarting units which are configured to not allow that, or force unwanted start of dbus-broker. (cherry picked from commit 8ea8e23) Resolves: RHEL-40878
…eload` For some units, the package would like to issue a reload. The machinery was already in place since c9615f7: systemctl reload-or-restart --marked Enqueues restart jobs for all units that have the 'needs-restart' mark, and reload jobs for units that have the 'needs-reload' mark. When a unit marked for reload does not support reload, restart will be queued. The new macros allow a reload to be issued instead of a restart. Based on the discussion on fedora-devel: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/IJSUGIEJNYZZRE53FF4YFUEBRHRAVIXR/ Tested using dummy package https://github.com/keszybz/rpm-test-reload. (cherry picked from commit 631d2b0) Resolves: RHEL-40878
This macros wraps the call to daemon-reexec in all user managers. It would be called for example from systemd %post right after the call to systemctl daemon-reexec. This will be used in the Fedora systemd package to fix a long-standing FIXME. Tested via building and reinstalling the systemd package with the patches. (cherry picked from commit 9ff28e3) Resolves: RHEL-40878
I am just trying to backport support for
%systemd_postun_with_reload
and backporting fix for (systemd/systemd#26799) along the way. I'll split it into two PRs if we go with the backport.%systemd_postun_with_reload
could be helpful in cases like this:osh-worker.service
improvements openscanhub/openscanhub#226/cc @kdudka