]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/transaction.h
Revert "core: add IgnoreOnSoftReboot= unit option"
[thirdparty/systemd.git] / src / core / transaction.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 typedef struct Transaction Transaction;
5
6 #include "hashmap.h"
7 #include "job.h"
8 #include "manager.h"
9 #include "unit.h"
10
11 struct Transaction {
12 /* Jobs to be added */
13 Hashmap *jobs; /* Unit object => Job object list 1:1 */
14 Job *anchor_job; /* the job the user asked for */
15 bool irreversible;
16 };
17
18 Transaction *transaction_new(bool irreversible);
19 Transaction *transaction_free(Transaction *tr);
20 Transaction *transaction_abort_and_free(Transaction *tr);
21 DEFINE_TRIVIAL_CLEANUP_FUNC(Transaction*, transaction_abort_and_free);
22
23 typedef enum TransactionAddFlags {
24 TRANSACTION_MATTERS = 1 << 0,
25 TRANSACTION_CONFLICTS = 1 << 1,
26 TRANSACTION_IGNORE_REQUIREMENTS = 1 << 2,
27 TRANSACTION_IGNORE_ORDER = 1 << 3,
28
29 /* Propagate a START job to other units like a RESTART */
30 TRANSACTION_PROPAGATE_START_AS_RESTART = 1 << 4,
31
32 /* Indicate that we're in the recursion for processing UNIT_ATOM_PROPAGATE_STOP_GRACEFUL units */
33 TRANSACTION_PROCESS_PROPAGATE_STOP_GRACEFUL = 1 << 5,
34 } TransactionAddFlags;
35
36 void transaction_add_propagate_reload_jobs(
37 Transaction *tr,
38 Unit *unit, Job *by,
39 TransactionAddFlags flags);
40
41 int transaction_add_job_and_dependencies(
42 Transaction *tr,
43 JobType type,
44 Unit *unit,
45 Job *by,
46 TransactionAddFlags flags,
47 sd_bus_error *e);
48
49 int transaction_activate(Transaction *tr, Manager *m, JobMode mode, Set *affected, sd_bus_error *e);
50 int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
51 int transaction_add_triggering_jobs(Transaction *tr, Unit *u);