1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-05 09:17:44 +03:00

socket: properly handle if our service vanished during runtime

This commit is contained in:
Lennart Poettering 2014-05-22 16:56:21 +09:00
parent f74df7baa2
commit 640ace4a8d

View File

@ -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;