summaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-16 19:41:11 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-16 19:41:11 +0200
commitcac6f7c87207b5079c1ae5c551869667bad4cfb8 (patch)
tree58897210ff03abbf1205c96c9e925cd20ac289c9 /src/service.c
parent276c3e78ceae3727c797820ba80c762acc727f4e (diff)
service: refuse to start services that are configured for per-connection instantiation to start without a socket
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c8
1 files changed, 8 insertions, 0 deletions
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;