manager: fix reloading in reload-or-restart --marked
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 28 Jul 2023 15:54:59 +0000 (17:54 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 7 Aug 2023 10:12:55 +0000 (12:12 +0200)
commit8ea8e23f4013dbc4f4a66c81eb786f0505434f2e
tree939b4a95abb122108e9598325ba9c9bcd8cbd478
parentf3d1d7609d2008086f0f8369d9f842a5c09024b2
manager: fix reloading in reload-or-restart --marked

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.
src/core/dbus-unit.c