chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fstab-generator: Honor mount.usr*= on kernel command line
[elogind.git]
/
src
/
core
/
manager.c
diff --git
a/src/core/manager.c
b/src/core/manager.c
index 7508fefaef2aa709691f76c3caf1b9a3fc8d0e2f..e0c1cd187e87db3d5aca127b083bcb8a30cf9475 100644
(file)
--- a/
src/core/manager.c
+++ b/
src/core/manager.c
@@
-436,7
+436,7
@@
int manager_new(SystemdRunningAs running_as, bool test_run, Manager **_m) {
m->exit_code = _MANAGER_EXIT_CODE_INVALID;
m->default_timer_accuracy_usec = USEC_PER_MINUTE;
m->start_timeout_usec = DEFAULT_MANAGER_START_TIMEOUT_USEC;
m->exit_code = _MANAGER_EXIT_CODE_INVALID;
m->default_timer_accuracy_usec = USEC_PER_MINUTE;
m->start_timeout_usec = DEFAULT_MANAGER_START_TIMEOUT_USEC;
- m->start_timeout_action = FAILURE_ACTION_
REBOOT
_FORCE;
+ m->start_timeout_action = FAILURE_ACTION_
POWEROFF
_FORCE;
m->idle_pipe[0] = m->idle_pipe[1] = m->idle_pipe[2] = m->idle_pipe[3] = -1;
m->idle_pipe[0] = m->idle_pipe[1] = m->idle_pipe[2] = m->idle_pipe[3] = -1;
@@
-449,27
+449,27
@@
int manager_new(SystemdRunningAs running_as, bool test_run, Manager **_m) {
if (r < 0)
goto fail;
if (r < 0)
goto fail;
- r = hashmap_ensure_allocated(&m->units,
string_hash_func, string_compare_func
);
+ r = hashmap_ensure_allocated(&m->units,
&string_hash_ops
);
if (r < 0)
goto fail;
if (r < 0)
goto fail;
- r = hashmap_ensure_allocated(&m->jobs,
trivial_hash_func, trivial_compare_func
);
+ r = hashmap_ensure_allocated(&m->jobs,
NULL
);
if (r < 0)
goto fail;
if (r < 0)
goto fail;
- r = hashmap_ensure_allocated(&m->cgroup_unit,
string_hash_func, string_compare_func
);
+ r = hashmap_ensure_allocated(&m->cgroup_unit,
&string_hash_ops
);
if (r < 0)
goto fail;
if (r < 0)
goto fail;
- r = hashmap_ensure_allocated(&m->watch_bus,
string_hash_func, string_compare_func
);
+ r = hashmap_ensure_allocated(&m->watch_bus,
&string_hash_ops
);
if (r < 0)
goto fail;
if (r < 0)
goto fail;
- r = set_ensure_allocated(&m->startup_units,
trivial_hash_func, trivial_compare_func
);
+ r = set_ensure_allocated(&m->startup_units,
NULL
);
if (r < 0)
goto fail;
if (r < 0)
goto fail;
- r = set_ensure_allocated(&m->failed_units,
trivial_hash_func, trivial_compare_func
);
+ r = set_ensure_allocated(&m->failed_units,
NULL
);
if (r < 0)
goto fail;
if (r < 0)
goto fail;
@@
-896,14
+896,14
@@
static int manager_coldplug(Manager *m) {
static void manager_build_unit_path_cache(Manager *m) {
char **i;
static void manager_build_unit_path_cache(Manager *m) {
char **i;
- _cleanup_
free
_ DIR *d = NULL;
+ _cleanup_
closedir
_ DIR *d = NULL;
int r;
assert(m);
set_free_free(m->unit_path_cache);
int r;
assert(m);
set_free_free(m->unit_path_cache);
- m->unit_path_cache = set_new(
string_hash_func, string_compare_func
);
+ m->unit_path_cache = set_new(
&string_hash_ops
);
if (!m->unit_path_cache) {
log_error("Failed to allocate unit path cache.");
return;
if (!m->unit_path_cache) {
log_error("Failed to allocate unit path cache.");
return;
@@
-2751,8
+2751,10
@@
int manager_environment_add(Manager *m, char **minus, char **plus) {
if (!strv_isempty(plus)) {
b = strv_env_merge(2, l, plus);
if (!strv_isempty(plus)) {
b = strv_env_merge(2, l, plus);
- if (!b)
+ if (!b) {
+ strv_free(a);
return -ENOMEM;
return -ENOMEM;
+ }
l = b;
}
l = b;
}
@@
-2837,7
+2839,7
@@
static bool manager_get_show_status(Manager *m) {
if (m->no_console_output)
return false;
if (m->no_console_output)
return false;
- if (!IN_SET(manager_state(m), MANAGER_STARTING, MANAGER_STOPPING))
+ if (!IN_SET(manager_state(m), MANAGER_
INITIALIZING, MANAGER_
STARTING, MANAGER_STOPPING))
return false;
if (m->show_status > 0)
return false;
if (m->show_status > 0)
@@
-2928,8
+2930,14
@@
ManagerState manager_state(Manager *m) {
assert(m);
/* Did we ever finish booting? If not then we are still starting up */
assert(m);
/* Did we ever finish booting? If not then we are still starting up */
- if (!dual_timestamp_is_set(&m->finish_timestamp))
+ if (!dual_timestamp_is_set(&m->finish_timestamp)) {
+
+ u = manager_get_unit(m, SPECIAL_BASIC_TARGET);
+ if (!u || !UNIT_IS_ACTIVE_OR_RELOADING(unit_active_state(u)))
+ return MANAGER_INITIALIZING;
+
return MANAGER_STARTING;
return MANAGER_STARTING;
+ }
/* Is the special shutdown target queued? If so, we are in shutdown state */
u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET);
/* Is the special shutdown target queued? If so, we are in shutdown state */
u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET);
@@
-2955,6
+2963,7
@@
ManagerState manager_state(Manager *m) {
}
static const char *const manager_state_table[_MANAGER_STATE_MAX] = {
}
static const char *const manager_state_table[_MANAGER_STATE_MAX] = {
+ [MANAGER_INITIALIZING] = "initializing",
[MANAGER_STARTING] = "starting",
[MANAGER_RUNNING] = "running",
[MANAGER_DEGRADED] = "degraded",
[MANAGER_STARTING] = "starting",
[MANAGER_RUNNING] = "running",
[MANAGER_DEGRADED] = "degraded",