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 Mar 16, 2018
1 parent e81b288 commit 2a02962
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 @@ -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

0 comments on commit 2a02962

Please sign in to comment.