]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/bus-unit-util.h
core: Record ExecMainStartTimestamp before forking
[thirdparty/systemd.git] / src / shared / bus-unit-util.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "sd-bus.h"
5
6 #include "install.h"
7 #include "pidref.h"
8 #include "unit-def.h"
9
10 typedef struct UnitInfo {
11 const char *machine;
12 const char *id;
13 const char *description;
14 const char *load_state;
15 const char *active_state;
16 const char *sub_state;
17 const char *following;
18 const char *unit_path;
19 uint32_t job_id;
20 const char *job_type;
21 const char *job_path;
22 } UnitInfo;
23
24 int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u);
25
26 int bus_append_unit_property_assignment(sd_bus_message *m, UnitType t, const char *assignment);
27 int bus_append_unit_property_assignment_many(sd_bus_message *m, UnitType t, char **l);
28
29 int bus_append_scope_pidref(sd_bus_message *m, const PidRef *pidref, bool allow_pidfd);
30
31 int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet);
32
33 int unit_load_state(sd_bus *bus, const char *name, char **load_state);
34
35 int unit_info_compare(const UnitInfo *a, const UnitInfo *b);
36
37 int bus_service_manager_reload(sd_bus *bus);
38
39 typedef struct UnitFreezer {
40 char *name;
41 sd_bus *bus;
42 } UnitFreezer;
43
44 int unit_freezer_new(const char *name, UnitFreezer *ret);
45 void unit_freezer_done(UnitFreezer *f);
46
47 int unit_freezer_freeze(UnitFreezer *f);
48 int unit_freezer_thaw(UnitFreezer *f);
49
50 int unit_freezer_new_freeze(const char *name, UnitFreezer *ret);
51
52 void unit_freezer_done_thaw(UnitFreezer *f);