summaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-05-22 16:56:21 +0900
committerLennart Poettering <lennart@poettering.net>2014-05-22 16:56:21 +0900
commit640ace4a8de907994a1b95f6d368c3e6a8fcf60f (patch)
treec3f95bd93d8dbfe320e7bf5f2d4098438611bf35 /src/core/socket.c
parentf74df7baa27a41440bda92cced2ca8d63742113f (diff)
socket: properly handle if our service vanished during runtime
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 05af8fe9d2..aca20fd106 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1503,6 +1503,12 @@ static void socket_enter_running(Socket *s, int cfd) {
}
if (!pending) {
+ if (!UNIT_ISSET(s->service)) {
+ log_error_unit(UNIT(s)->id, "%s: service to activate vanished, refusing activation.", UNIT(s)->id);
+ r = -ENOENT;
+ goto fail;
+ }
+
r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT_DEREF(s->service), JOB_REPLACE, true, &error, NULL);
if (r < 0)
goto fail;