mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-26 09:57:26 +03:00
core: don't reference rescue/emergency targets in --user mode
They are only defined for system mode, hence let's not check for them in --user mode. Follow-up for #7433
This commit is contained in:
parent
0126c8f3f6
commit
45a7b16bae
@ -3546,14 +3546,16 @@ ManagerState manager_state(Manager *m) {
|
||||
if (u && unit_active_or_pending(u))
|
||||
return MANAGER_STOPPING;
|
||||
|
||||
/* Are the rescue or emergency targets active or queued? If so we are in maintenance state */
|
||||
u = manager_get_unit(m, SPECIAL_RESCUE_TARGET);
|
||||
if (u && unit_active_or_pending(u))
|
||||
return MANAGER_MAINTENANCE;
|
||||
if (MANAGER_IS_SYSTEM(m)) {
|
||||
/* Are the rescue or emergency targets active or queued? If so we are in maintenance state */
|
||||
u = manager_get_unit(m, SPECIAL_RESCUE_TARGET);
|
||||
if (u && unit_active_or_pending(u))
|
||||
return MANAGER_MAINTENANCE;
|
||||
|
||||
u = manager_get_unit(m, SPECIAL_EMERGENCY_TARGET);
|
||||
if (u && unit_active_or_pending(u))
|
||||
return MANAGER_MAINTENANCE;
|
||||
u = manager_get_unit(m, SPECIAL_EMERGENCY_TARGET);
|
||||
if (u && unit_active_or_pending(u))
|
||||
return MANAGER_MAINTENANCE;
|
||||
}
|
||||
|
||||
/* Are there any failed units? If so, we are in degraded mode */
|
||||
if (set_size(m->failed_units) > 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user