summaryrefslogtreecommitdiffstats
path: root/src/core/transaction.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-06-30 18:17:06 +0200
committerLennart Poettering <lennart@poettering.net>2023-07-03 17:31:25 +0200
commit09d04ad325473e05e23e6ba8382d7de1dd819bda (patch)
tree6baa9e91185272afed733efb419cd070c4a463d0 /src/core/transaction.h
parentservice: re-linebreak some comments matching current coding style (diff)
downloadsystemd-09d04ad325473e05e23e6ba8382d7de1dd819bda.tar.xz
systemd-09d04ad325473e05e23e6ba8382d7de1dd819bda.zip
core: introduce a new job mode JOB_RESTART_DEPENDENCIES
This new job mode will enqueue a start job for a unit, and all units depending on the unit will get a restart job enqueued. This is then used for automatic sevice restarts: the unit itself is only started, the depending units restarted. This way the unit will not go down unnecessarily, triggering OnSuccess= needlessly. This also introduces a new state SERVICE_AUTO_RESTART_QUEUED that is entered once the restart jobs are enqueued. Previously we'd stay in SERVICE_AUTO_RESTART, but that's problematic, since we'd lose information whether we still need to enqueue the restart job during a serialization/deserialization cycle or not. By having an explicit state for this we know exactly whether we still need to enqueue the job or not. It's also good since when we are in SERVICE_AUTO_RESTART_QUEUED we want to act on unit_start(), but on SERVICE_AUTO_RESTART we want to wait for the holdoff time to pass before we act on unit_start(). Fixes: #27722
Diffstat (limited to '')
-rw-r--r--src/core/transaction.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/transaction.h b/src/core/transaction.h
index 5874077aef..db2d056649 100644
--- a/src/core/transaction.h
+++ b/src/core/transaction.h
@@ -21,10 +21,13 @@ Transaction *transaction_abort_and_free(Transaction *tr);
DEFINE_TRIVIAL_CLEANUP_FUNC(Transaction*, transaction_abort_and_free);
typedef enum TransactionAddFlags {
- TRANSACTION_MATTERS = 1 << 0,
- TRANSACTION_CONFLICTS = 1 << 1,
- TRANSACTION_IGNORE_REQUIREMENTS = 1 << 2,
- TRANSACTION_IGNORE_ORDER = 1 << 3,
+ TRANSACTION_MATTERS = 1 << 0,
+ TRANSACTION_CONFLICTS = 1 << 1,
+ TRANSACTION_IGNORE_REQUIREMENTS = 1 << 2,
+ TRANSACTION_IGNORE_ORDER = 1 << 3,
+
+ /* Propagate a START job to other units like a RESTART */
+ TRANSACTION_PROPAGATE_START_AS_RESTART = 1 << 4,
} TransactionAddFlags;
void transaction_add_propagate_reload_jobs(