Fix RemainAfterExit services keeping a hold on console

When a service exits succesfully and has RemainAfterExit set, its hold
on the console (in m->n_on_console) wasn't released since the unit state
didn't change.
This commit is contained in:
Olivier Brunel
2013-11-16 12:08:11 -05:00
committed by Zbigniew Jędrzejewski-Szmek
parent ad929fe196
commit 9cd861842c
3 changed files with 19 additions and 2 deletions
+3
View File
@@ -1490,6 +1490,9 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
if (UNIT_IS_INACTIVE_OR_FAILED(ns))
unit_destroy_cgroup(u);
/* Note that this doesn't apply to RemainAfterExit services exiting
* sucessfully, since there's no change of state in that case. Which is
* why it is handled in service_set_state() */
if (UNIT_IS_INACTIVE_OR_FAILED(os) != UNIT_IS_INACTIVE_OR_FAILED(ns)) {
ExecContext *ec = unit_get_exec_context(u);
if (ec && exec_context_may_touch_console(ec)) {