summaryrefslogtreecommitdiffstats
path: root/src/cfg_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cfg_utils.c')
-rw-r--r--src/cfg_utils.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cfg_utils.c b/src/cfg_utils.c
index 8575b254b..dbd4f0f83 100644
--- a/src/cfg_utils.c
+++ b/src/cfg_utils.c
@@ -196,7 +196,7 @@ gboolean
parse_bind_line (struct config_file *cfg, struct worker_conf *cf, const gchar *str)
{
struct rspamd_worker_bind_conf *cnf;
- gchar **tokens, *tmp;
+ gchar **tokens, *tmp, *err;
gboolean ret;
if (str == NULL) {
@@ -238,6 +238,14 @@ parse_bind_line (struct config_file *cfg, struct worker_conf *cf, const gchar *s
}
tokens[0] = tmp;
}
+ else if (strcmp (tokens[0], "systemd") == 0) {
+ /* The actual socket will be passed by systemd environment */
+ cnf->bind_host = memory_pool_strdup (cfg->cfg_pool, str);
+ cnf->ai = strtoul (tokens[1], &err, 10);
+ if (err == NULL || *err == '\0') {
+ LL_PREPEND (cf->bind_conf, cnf);
+ }
+ }
else {
if ((ret = parse_host_port_priority_strv (cfg->cfg_pool, tokens,
&cnf->bind_host, &cnf->bind_port, NULL, DEFAULT_BIND_PORT))) {