Skip to content

Commit

Permalink
Use line breaks and continuation for run flags
Browse files Browse the repository at this point in the history
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 garethr#660
  • Loading branch information
electrofelix committed Jun 9, 2017
1 parent 40194a2 commit 8e5996c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/puppet/parser/functions/docker_run_flags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8e5996c

Please sign in to comment.