summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorOlivier Brunel <jjk@jjacky.com>2013-11-14 15:52:54 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-11-16 12:08:11 -0500
commit9cd861842ccb07372fbd665f2e6c054daaedacb4 (patch)
treea724b96b5aa369b958bd3d3703fc356ecbb1625f /src/core/unit.c
parentad929fe19673ff7135d570f458edef755ec34410 (diff)
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.
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 84c43f721a..7f463f311b 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -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)) {