chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: introduce system state enum
[elogind.git]
/
src
/
core
/
manager.h
diff --git
a/src/core/manager.h
b/src/core/manager.h
index 398c8e642ed41d81b2566f54edbc57505ae16fec..38f1c89c930c6889701b20e3352acb20fcbd1949 100644
(file)
--- a/
src/core/manager.h
+++ b/
src/core/manager.h
@@
-35,8
+35,18
@@
typedef struct Manager Manager;
typedef struct Manager Manager;
-typedef enum ManagerExitCode {
+typedef enum ManagerState {
+ MANAGER_STARTING,
MANAGER_RUNNING,
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,
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 "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
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 */
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;
sd_event_source *run_queue_event_source;
char *notify_socket;
@@
-227,7
+241,7
@@
struct Manager {
bool default_memory_accounting;
bool default_blockio_accounting;
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;
/* non-zero if we are reloading or reexecuting, */
int n_reloading;
@@
-318,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);
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_;