Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-6001

Incomplete process table due to COLUMNS variable

    Details

    • Template:
    • Team:
      Platform OS
    • Story Points:
      1

      Description

      The ps command from the procps-ng project which is used on Debian and Ubuntu honours the environment variable COLUMNS: when set to a number, output lines are cut of at that many positions. The difference can be seen with these two commands:
      $ COLUMNS= ps -ef > /tmp/env1
      $ COLUMNS=80 ps -ef > /tmp/env2
      So, if COLUMNS is set, then the process table is most likely incomplete.

      I see this happening on our Debian "wheezy" systems, where COLUMNS exists in the environment in which the Puppet agent is started. Puppet apparently doesn't clean up its environment before it executes subcommands, so COLUMNS leaks through to ps resulting in an incomplete process table. And that causes problems with services that have hasstatus=>false and Puppet has to try to match the process in the process table, in our case a few similar services with patterns like 'rbldnsd.*spamhaus'.
      The bug doesn't manifest on Ubuntu because COLUMNS is not set there.
      I don't know about other operating systems.

      The fix to this particular problem is that Puppet should delete COLUMNS from the environment before executing ps. But maybe a generic solution is better, in which Puppet sanitizes the complete environment before executing subcommands.

      References:
      https://gitlab.com/procps-ng/procps
      http://manpages.debian.org/cgi-bin/man.cgi?query=ps&apropos=0&sektion=0&manpath=Debian+7.8+wheezy&format=html&locale=en

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rj667 Robert Scheer
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Zendesk Support