summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-09-30 02:19:12 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-05 19:50:00 +0200
commitd9ff321ad9477664c34b81a9dd4fce616e44124e (patch)
tree96d0cc7c435b52309253b584b2b61f13096b61c1 /src/socket.c
parent20ed3656786a36f58a27901356e67d03cdd6de5e (diff)
socket: make service to start on incoming traffic configurable
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/socket.c b/src/socket.c
index aacf9bed9f..bbb54f6308 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -212,6 +212,11 @@ static int socket_verify(Socket *s) {
return -EINVAL;
}
+ if (s->accept && s->service) {
+ log_error("Explicit service configuration for accepting sockets not supported on %s. Refusing.", s->meta.id);
+ return -EINVAL;
+ }
+
if (s->exec_context.pam_name && s->exec_context.kill_mode != KILL_CONTROL_GROUP) {
log_error("%s has PAM enabled. Kill mode must be set to 'control-group'. Refusing.", s->meta.id);
return -EINVAL;
@@ -315,8 +320,10 @@ static int socket_load(Unit *u) {
if (u->meta.load_state == UNIT_LOADED) {
if (have_non_accept_socket(s)) {
- if ((r = unit_load_related_unit(u, ".service", (Unit**) &s->service)) < 0)
- return r;
+
+ if (!s->service)
+ if ((r = unit_load_related_unit(u, ".service", (Unit**) &s->service)) < 0)
+ return r;
if ((r = unit_add_dependency(u, UNIT_BEFORE, UNIT(s->service), true)) < 0)
return r;