From cac6f7c87207b5079c1ae5c551869667bad4cfb8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 16 Jul 2010 19:41:11 +0200 Subject: service: refuse to start services that are configured for per-connection instantiation to start without a socket --- fixme | 4 ++++ src/service.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/fixme b/fixme index a3c99500c7..b4f82a3c9d 100644 --- a/fixme +++ b/fixme @@ -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: diff --git a/src/service.c b/src/service.c index 646749ed9c..1bfab5013d 100644 --- a/src/service.c +++ b/src/service.c @@ -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; -- cgit v1.2.3-54-g00ecf