service: refuse to start services that are configured for per-connection instantiation to start without a socket

This commit is contained in:
Lennart Poettering 2010-07-16 19:41:11 +02:00
parent 276c3e78ce
commit cac6f7c872
2 changed files with 12 additions and 0 deletions

4
fixme
View File

@ -65,6 +65,10 @@
* debian deadlock when partition auf noauto is.
* maintenance units müssen vergessen werden
* maintenance muss dokumentiert werden
External:
* patch /etc/init.d/functions with:

View File

@ -1896,6 +1896,14 @@ static int service_start(Unit *u) {
return -ECANCELED;
}
if ((s->exec_context.std_input == EXEC_INPUT_SOCKET ||
s->exec_context.std_output == EXEC_OUTPUT_SOCKET ||
s->exec_context.std_error == EXEC_OUTPUT_SOCKET) &&
s->socket_fd < 0) {
log_warning("%s can only be started with a per-connection socket.", u->meta.id);
return -EINVAL;
}
s->failure = false;
s->main_pid_known = false;
s->allow_restart = true;