X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fmanager.h;h=38f1c89c930c6889701b20e3352acb20fcbd1949;hp=9dee48ddded2a72dd21f26875c7e031493129e84;hb=3d94f76c99da13e5603831d0b278f8c8c21bcb02;hpb=085afe36cb823e7d5b8c5f3ef21ebb9639bac78b diff --git a/src/core/manager.h b/src/core/manager.h index 9dee48ddd..38f1c89c9 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -35,8 +35,18 @@ typedef struct Manager Manager; -typedef enum ManagerExitCode { +typedef enum ManagerState { + MANAGER_STARTING, MANAGER_RUNNING, + MANAGER_DEGRADED, + MANAGER_MAINTENANCE, + MANAGER_STOPPING, + _MANAGER_STATE_MAX, + _MANAGER_STATE_INVALID = -1 +} ManagerState; + +typedef enum ManagerExitCode { + MANAGER_OK, MANAGER_EXIT, MANAGER_RELOAD, MANAGER_REEXECUTE, @@ -58,6 +68,7 @@ typedef enum ManagerExitCode { #include "execute.h" #include "unit-name.h" #include "exit-status.h" +#include "show-status.h" struct Manager { /* Note that the set of units we know of is allowed to be @@ -105,6 +116,9 @@ struct Manager { Hashmap *watch_pids1; /* pid => Unit object n:1 */ Hashmap *watch_pids2; /* pid => Unit object n:1 */ + /* A set which contains all currently failed units */ + Set *failed_units; + sd_event_source *run_queue_event_source; char *notify_socket; @@ -167,7 +181,13 @@ struct Manager { Set *private_buses; int private_listen_fd; sd_event_source *private_listen_event_source; - Set *subscribed; + + /* Contains all the clients that are subscribed to signals via + the API bus. Note that private bus connections are always + considered subscribes, since they last for very short only, + and it is much simpler that way. */ + sd_bus_track *subscribed; + char **deserialized_subscribed; sd_bus_message *queued_message; /* This is used during reloading: * before the reload we queue the @@ -221,7 +241,7 @@ struct Manager { bool default_memory_accounting; bool default_blockio_accounting; - struct rlimit *rlimit[RLIMIT_NLIMITS]; + struct rlimit *rlimit[_RLIMIT_MAX]; /* non-zero if we are reloading or reexecuting, */ int n_reloading; @@ -312,3 +332,10 @@ void manager_status_printf(Manager *m, bool ephemeral, const char *status, const void manager_flip_auto_status(Manager *m, bool enable); Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path); + +const char *manager_get_runtime_prefix(Manager *m); + +ManagerState manager_state(Manager *m); + +const char *manager_state_to_string(ManagerState m) _const_; +ManagerState manager_state_from_string(const char *s) _pure_;