From 8e5996c06cc632f5cd02da3f25c9e7ac6dcf2de1 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Fri, 9 Jun 2017 10:29:48 +0100 Subject: [PATCH] Use line breaks and continuation for run flags Switch from joining the docker_run_flags using spaces to new lines and continuations to avoid hitting the glibc MAX_LINE limit used by systemd. As docker_run_flags is used to provide the args to init scripts and systemd, switching it to use line continuation and newlines is sufficient to ensure that systemd/initscritps do not hit any limit imposed by glibc on a readline and at the same time know to continue processing onto the next line for the rest of the command to be run. Fixes #660 --- lib/puppet/parser/functions/docker_run_flags.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/puppet/parser/functions/docker_run_flags.rb b/lib/puppet/parser/functions/docker_run_flags.rb index 10a66f6f6..163204413 100644 --- a/lib/puppet/parser/functions/docker_run_flags.rb +++ b/lib/puppet/parser/functions/docker_run_flags.rb @@ -76,6 +76,8 @@ module Puppet::Parser::Functions flags << param end - flags.flatten.join(" ") + # Some software (systemd) will truncate very long lines using glibc's max + # line length. Wrap options across multiple lines with '\' to avoid + flags.flatten.join(" \\\n ") end end