Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-704

Docker support for virtual and is_virtual broken by systemd slices

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: FACT 2.2.0
    • Fix Version/s: FACT 2.4.5, FACT 3.1.0
    • Component/s: None
    • Labels:
    • Environment:
    • Template:
    • Story Points:
      1
    • Sprint:
      Client 2015-07-08
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The detection of docker for the virtual fact was broken with the introduction of systemd slices that changed the cgroup paths. Facter was updated to detect docker when slices are being used.

      Description

      Adrien Thebo said:

      It definitely looks like the introduction of systemd slices changed the structure of the cgroup entries in /proc/1/cgroup

      And this is the new structure:

      $ docker run -it --rm h0tbird/base cat /proc/1/cgroup 
      8:blkio:/system.slice/docker-2c34fb3b1aeb2451badbbaef5e45146435790af27917ab183a191425dca14639.scope
      7:net_cls:/
      6:freezer:/system.slice/docker-2c34fb3b1aeb2451badbbaef5e45146435790af27917ab183a191425dca14639.scope
      5:devices:/system.slice/docker-2c34fb3b1aeb2451badbbaef5e45146435790af27917ab183a191425dca14639.scope
      4:memory:/system.slice/docker-2c34fb3b1aeb2451badbbaef5e45146435790af27917ab183a191425dca14639.scope
      3:cpu,cpuacct:/system.slice/docker-2c34fb3b1aeb2451badbbaef5e45146435790af27917ab183a191425dca14639.scope
      2:cpuset:/
      1:name=systemd:/system.slice/docker-2c34fb3b1aeb2451badbbaef5e45146435790af27917ab183a191425dca14639.scope
      

      The bug can be reproduced like this:

      $ docker run -it --rm h0tbird/base facter virtual is_virtual
      is_virtual => false
      virtual => physical
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            h0tbird Marc Villacorta
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support