From 2a029621aa91607a1efd5b822d49a53c0795173d 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 741552d1..57a9a9b7 100644 --- a/lib/puppet/parser/functions/docker_run_flags.rb +++ b/lib/puppet/parser/functions/docker_run_flags.rb @@ -82,6 +82,8 @@ module Puppet::Parser::Functions flags << param end - flags.flatten.join(' ') + # Some software (inc 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