2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2012-07-18 19:07:51 +02:00
|
|
|
#pragma once
|
2010-02-01 03:33:24 +01:00
|
|
|
|
2018-05-28 06:36:35 +02:00
|
|
|
#include "sd-bus.h"
|
|
|
|
|
2010-02-01 03:33:24 +01:00
|
|
|
#include "manager.h"
|
|
|
|
|
2018-11-13 11:59:06 +01:00
|
|
|
int bus_send_pending_reload_message(Manager *m);
|
2013-11-19 21:12:59 +01:00
|
|
|
|
core: rework how we connect to the bus
This removes the current bus_init() call, as it had multiple problems:
it munged handling of the three bus connections we care about (private,
"api" and system) into one, even though the conditions when which was
ready are very different. It also added redundant logging, as the
individual calls it called all logged on their own anyway.
The three calls bus_init_api(), bus_init_private() and bus_init_system()
are now made public. A new call manager_dbus_is_running() is added that
works much like manager_journal_is_running() and is a lot more careful
when checking whether dbus is around. Optionally it checks the unit's
deserialized_state rather than state, in order to accomodate for cases
where we cant to connect to the bus before deserializing the
"subscribed" list, before coldplugging the units.
manager_recheck_dbus() is added, that works a lot like
manager_recheck_journal() and is invoked in unit_notify(), i.e. when
units change state.
All in all this should make handling a bit more alike to journal
handling, and it also fixes one major bug: when running in user mode
we'll now connect to the system bus early on, without conditionalizing
this in anyway.
2018-02-07 14:52:22 +01:00
|
|
|
int bus_init_private(Manager *m);
|
|
|
|
int bus_init_api(Manager *m);
|
|
|
|
int bus_init_system(Manager *m);
|
2018-02-07 15:00:32 +01:00
|
|
|
|
|
|
|
void bus_done_private(Manager *m);
|
|
|
|
void bus_done_api(Manager *m);
|
|
|
|
void bus_done_system(Manager *m);
|
2010-06-19 03:04:04 +02:00
|
|
|
void bus_done(Manager *m);
|
2010-02-01 03:33:24 +01:00
|
|
|
|
2011-04-28 22:07:01 +02:00
|
|
|
int bus_fdset_add_all(Manager *m, FDSet *fds);
|
|
|
|
|
2016-08-15 18:12:01 +02:00
|
|
|
void bus_track_serialize(sd_bus_track *t, FILE *f, const char *prefix);
|
|
|
|
int bus_track_coldplug(Manager *m, sd_bus_track **t, bool recursive, char **l);
|
2014-03-03 01:33:45 +01:00
|
|
|
|
|
|
|
int bus_foreach_bus(Manager *m, sd_bus_track *subscribed2, int (*send_message)(sd_bus *bus, void *userdata), void *userdata);
|
2014-08-06 11:45:36 +02:00
|
|
|
|
2015-02-18 17:40:57 +01:00
|
|
|
int bus_verify_manage_units_async(Manager *m, sd_bus_message *call, sd_bus_error *error);
|
2014-08-06 11:45:36 +02:00
|
|
|
int bus_verify_manage_unit_files_async(Manager *m, sd_bus_message *call, sd_bus_error *error);
|
|
|
|
int bus_verify_reload_daemon_async(Manager *m, sd_bus_message *call, sd_bus_error *error);
|
2015-02-18 17:40:57 +01:00
|
|
|
int bus_verify_set_environment_async(Manager *m, sd_bus_message *call, sd_bus_error *error);
|
2016-05-04 20:43:23 +02:00
|
|
|
|
|
|
|
int bus_forward_agent_released(Manager *m, const char *path);
|
2018-02-13 18:30:34 +01:00
|
|
|
|
|
|
|
uint64_t manager_bus_n_queued_write(Manager *m);
|
2018-05-28 11:13:19 +02:00
|
|
|
|
|
|
|
void dump_bus_properties(FILE *f);
|
2020-04-23 23:50:31 +02:00
|
|
|
int bus_manager_introspect_implementations(FILE *out, const char *pattern);
|