summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
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;