|
|
f27ed14 |
From b667a525077329c2ddd8bb3a646839a1acf98201 Mon Sep 17 00:00:00 2001
|
|
|
f27ed14 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
f27ed14 |
Date: Mon, 17 Sep 2012 14:55:56 +0200
|
|
|
f27ed14 |
Subject: [PATCH] service: don't hit an assert if a service unit changes type
|
|
|
f27ed14 |
and we get a spurious event from before (cherry picked from
|
|
|
f27ed14 |
commit bfba3256a02a0871579c4ee48d787dfe4585fd8d)
|
|
|
f27ed14 |
|
|
|
f27ed14 |
Conflicts:
|
|
|
f27ed14 |
TODO
|
|
|
f27ed14 |
---
|
|
|
f27ed14 |
src/core/service.c | 10 +++++-----
|
|
|
f27ed14 |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
f27ed14 |
|
|
|
f27ed14 |
diff --git a/src/core/service.c b/src/core/service.c
|
|
|
f27ed14 |
index d300e34..b2d493a 100644
|
|
|
f27ed14 |
--- a/src/core/service.c
|
|
|
f27ed14 |
+++ b/src/core/service.c
|
|
|
f27ed14 |
@@ -2944,12 +2944,10 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
|
|
|
f27ed14 |
else
|
|
|
f27ed14 |
service_enter_signal(s, SERVICE_FINAL_SIGTERM, f);
|
|
|
f27ed14 |
break;
|
|
|
f27ed14 |
- } else {
|
|
|
f27ed14 |
- assert(s->type == SERVICE_DBUS || s->type == SERVICE_NOTIFY);
|
|
|
f27ed14 |
-
|
|
|
f27ed14 |
- /* Fall through */
|
|
|
f27ed14 |
}
|
|
|
f27ed14 |
|
|
|
f27ed14 |
+ /* Fall through */
|
|
|
f27ed14 |
+
|
|
|
f27ed14 |
case SERVICE_RUNNING:
|
|
|
f27ed14 |
service_enter_running(s, f);
|
|
|
f27ed14 |
break;
|
|
|
f27ed14 |
@@ -3019,7 +3017,9 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
|
|
|
f27ed14 |
break;
|
|
|
f27ed14 |
|
|
|
f27ed14 |
case SERVICE_START:
|
|
|
f27ed14 |
- assert(s->type == SERVICE_FORKING);
|
|
|
f27ed14 |
+ if (s->type != SERVICE_FORKING)
|
|
|
f27ed14 |
+ /* Maybe spurious event due to a reload that changed the type? */
|
|
|
f27ed14 |
+ break;
|
|
|
f27ed14 |
|
|
|
f27ed14 |
if (f != SERVICE_SUCCESS) {
|
|
|
f27ed14 |
service_enter_signal(s, SERVICE_FINAL_SIGTERM, f);
|